Esempio n. 1
0
 public DataMember(SchemaMember schemaMem) : base(schemaMem.Hierarchy)
 {
     this._uniqueName = schemaMem.UniqueName;
     this._name       = schemaMem.Name;
     this._childCount = schemaMem.ChildCount;
     this._levelDepth = schemaMem.LevelDepth;
 }
Esempio n. 2
0
        public SchemaMembers GetMemberParentWithSiblings(Hierarchy hier, string MemUniqueName)
        {
            SchemaMember smem = new SchemaMember(hier);

            System.Xml.XmlElement parentEl = GetMemberParentWithSiblings(hier.UniqueName, MemUniqueName);
            smem.LoadChildrenFromXmlSchema(parentEl);
            return(smem.Children);
        }
Esempio n. 3
0
        public SchemaMembers GetMemberChildren(Hierarchy hier, string UniqueName, bool IfLeafAddItself)
        {
            SchemaMember smem = new SchemaMember(hier);

            System.Xml.XmlElement parentEl = GetMemberChildren(UniqueName, IfLeafAddItself);
            smem.LoadChildrenFromXmlSchema(parentEl);
            return(smem.Children);
        }
 public void LoadChildrenFromXmlSchema(System.Xml.XmlElement xmlEl)
 {
     foreach (System.Xml.XmlElement childEl in xmlEl.ChildNodes)
     {
         SchemaMember child = new SchemaMember(this.Hierarchy);
         child.LoadFromXmlSchema(childEl);                // , this.Siblings);
         this.Children.Add(child, false);
     }
 }
 public SchemaMember Find(string UniqueName)
 {
     for (int i = 0; i < this.Count; i++)
     {
         SchemaMember mem = (SchemaMember)this[i].Find(UniqueName);
         if (mem != null)
         {
             return(mem);
         }
     }
     return(null);
 }
Esempio n. 6
0
        public SchemaMember GetMemberParent(Hierarchy hier, string MemUniqueName)
        {
            System.Xml.XmlElement parentEl = GetMemberParent(hier.UniqueName, MemUniqueName);
            XmlElement            memEl    = (XmlElement)parentEl.FirstChild;

            if (memEl != null)
            {
                SchemaMember smem = new SchemaMember(hier);
                smem.LoadFromXml(memEl);
                return(smem);
            }
            return(null);
        }
Esempio n. 7
0
        public void Insert(int Index, Member Member, bool replaceExisting)
        {
            SchemaMember smem = Member as SchemaMember;

            if (smem != null)
            {
                this.Insert(Index, smem, replaceExisting);
            }
            else
            {
                this.Insert(Index, (DataMember)Member, replaceExisting);
            }
        }
Esempio n. 8
0
        public SchemaMembers GetSchemaMembers(Hierarchy hier, string[] UniqueNames)
        {
            System.Xml.XmlElement parentEl = GetSchemaMembers(UniqueNames);

            SchemaMembers smems = new SchemaMembers(hier, null);

            foreach (System.Xml.XmlElement childEl in parentEl.ChildNodes)
            {
                SchemaMember child = new SchemaMember(hier);
                child.LoadFromXmlSchema(childEl);
                smems.Add(child, false);
            }
            return(smems);
        }
        internal SchemaMembers(Hierarchy hier, SchemaMember parentMem)
        {
            if (hier == null)
            {
                throw new ArgumentNullException("Hierarchy is null");
            }
            _hier = hier;

            if (parentMem != null && parentMem.Hierarchy != hier)
            {
                throw new Exception("Hierarchy mismatch");
            }
            _parentMem = parentMem;
        }
Esempio n. 10
0
        public virtual void LoadFromXmlSchema(System.Xml.XmlElement xmlEl)
        {
            _uniqueName = xmlEl.GetAttribute("UN");
            _name       = xmlEl.GetAttribute("N");
            _depth      = short.Parse(xmlEl.GetAttribute("LD"));

            System.Xml.XmlElement childEl = (System.Xml.XmlElement)xmlEl.FirstChild;

            if (childEl != null && childEl.Name == "DM")        //default member
            {
                SchemaMember smem = new SchemaMember(this.Hierarchy);
                smem.LoadFromXml(childEl);
                this._defaultMember = smem;
            }
        }
Esempio n. 11
0
        public void Insert(int index, SchemaMember member, bool replaceExisting)
        {
            DataMember dmem = new DataMember(member);

            this.Insert(index, dmem, replaceExisting);
        }
Esempio n. 12
0
 public void Add(SchemaMember member, bool replaceExisting)
 {
     this.Insert(this.Count, member, replaceExisting);
 }