Esempio n. 1
0
        private XConfigNode(IDEConfigurationElement configurationElement, XElement element)
        {
            this.configurationElement = configurationElement ?? throw new ArgumentNullException(nameof(configurationElement));

            getElements = new Lazy <Dictionary <string, IDEConfigurationAnnotated> >(() =>
            {
                var r = new Dictionary <string, IDEConfigurationAnnotated>(StringComparer.OrdinalIgnoreCase);

                // value of the element
                if (configurationElement.Value != null)
                {
                    r[String.Empty] = null;
                }

                // sub attributes
                foreach (var attr in configurationElement.GetAttributes())
                {
                    r[attr.Name.LocalName] = attr;
                }

                // sub elements
                foreach (var el in configurationElement.GetElements())
                {
                    r[el.Name.LocalName] = el;
                }
                return(r);
            }
                                                                                     );

            this.element = element;
        }         // ctor
Esempio n. 2
0
            public XConfigNodes(XElement parentElement, IDEConfigurationElement configurationElement)
            {
                if (parentElement == null)
                {
                    throw new ArgumentNullException(nameof(parentElement));
                }

                this.configurationElement = configurationElement ?? throw new ArgumentNullException(nameof(configurationElement));
                elements   = parentElement.Elements(configurationElement.Name).Select(x => new XConfigNode(configurationElement, x)).ToArray();
                primaryKey = configurationElement.GetAttributes().FirstOrDefault(a => a.IsPrimaryKey);
            }             // ctor
Esempio n. 3
0
 public XConfigNode(IDEConfigurationElement elementDefinition, XElement element)
 {
     this.attributes = elementDefinition.GetAttributes().ToArray();
     this.element    = element;
 }         // ctor