public void ApplyDetectedValues()
{
var properties = detector.GetDetectedProperty();
foreach (var property in properties)
{
PtfProperty p = ptfconfig.GetPropertyNodeByName(property.Key);
if (p == null) throw new Exception(string.Format("Cannot find property by name {0}.", property.Key));
if (property.Value == null || property.Value.Count == 0) p.Value = null;
else if (property.Value.Count == 1) p.Value = property.Value[0];
else
{
p.ChoiceItems = property.Value;
p.Value = property.Value[0];
}
}
}