Пример #1
0
 internal Component(ComponentDescriptor descriptor, Device device)
     : base(descriptor.Properties)
 {
     XmlNodeName   = descriptor.Type;
     ComponentType = descriptor.Type;
     m_device      = device;
 }
Пример #2
0
        public static ComponentDescriptor[] GetComponentDescriptors(XElement componentElement)
        {
            List <ComponentDescriptor> descriptors = new List <ComponentDescriptor>();
            var componentsList = componentElement.Element(componentElement.Name.Namespace + NodeNames.Components);

            if (componentsList != null)
            {
                foreach (var compNode in componentsList.Elements())
                {
                    var cd = new ComponentDescriptor(compNode.Name.LocalName, PropertyCollection.FromAttributes(compNode.Attributes()));
                    descriptors.Add(cd);
                }
            }

            return(descriptors.ToArray());
        }