Microsoft.Protocols.TestManager.Kernel.Utility.ApplyDetectedValues C# (CSharp) Method

ApplyDetectedValues() public method

Apply the property values detected by the plug-in.
public ApplyDetectedValues ( ) : void
return void
        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];
                }
            }
        }