public void Add(DTDAttributeDefinition def)
 {
     if (this.attributeOrders[def.Name] != null)
     {
         throw new InvalidOperationException(string.Format("Attribute definition for {0} was already added at element {1}.", def.Name, this.Name));
     }
     def.SetRoot(base.Root);
     this.attributeOrders.Add(def.Name, this.attributes.Count);
     this.attributes.Add(def);
 }
Exemplo n.º 2
0
        public void Add(string name, DTDAttListDeclaration decl)
        {
            DTDAttListDeclaration dtdattListDeclaration = this[name];

            if (dtdattListDeclaration != null)
            {
                foreach (object obj in decl.Definitions)
                {
                    DTDAttributeDefinition dtdattributeDefinition = (DTDAttributeDefinition)obj;
                    if (decl.Get(dtdattributeDefinition.Name) == null)
                    {
                        dtdattListDeclaration.Add(dtdattributeDefinition);
                    }
                }
            }
            else
            {
                decl.SetRoot(base.Root);
                base.BaseAdd(name, decl);
            }
        }