예제 #1
0
        public ComplexTypeAttribute[] getAttributes(bool countInherited, bool countOwn, bool includeOptional)
        {
            var c    = this.countAttributes(countInherited, countOwn, includeOptional);
            var attr = new ComplexTypeAttribute[c];
            var j    = 0;

            for (int i = 0; i < this.index; i++)
            {
                if ((includeOptional || (!this.attributes[i].isOptionalAttribute())) && ((countInherited && this.attributes[i].isInheritedAttribute()) || (countOwn && !this.attributes[i].isInheritedAttribute())))
                {
                    attr[j++] = this.attributes[i];
                }
            }

            return(attr);
        }
예제 #2
0
        public void addItem(string item, string type, string min, string max, bool isInherited, string nsext)
        {
            var iMax = (max == "unbounded") ? 99 : Convert.ToInt32(max);
            //add to attributes
            var isOption = (min == "0");
            var attr     = new ComplexTypeAttribute(item, type, isOption, iMax, isInherited, nsext);

            //only add if no duplicate
            for (int i = 0; i < this.index; i++)
            {
                if (this.attributes[i].isDuplicate(attr))
                {
                    return;
                }
            }

            this.attributes[this.index] = attr;
            this.index++;
        }
예제 #3
0
 public bool isDuplicate(ComplexTypeAttribute check)
 {
     return(this.getName() == check.getName() && this.getType() == check.getType());
 }