示例#1
0
        public ICsiContainer ChangeItemByIndex(int index)
        {
            CsiContainer sourceElement = new CsiContainer(this.GetOwnerDocument(), "__listItem", this);

            sourceElement.SetAttribute("__listItemAction", "change");
            CsiXmlHelper.FindCreateSetValue(sourceElement, "__index", Convert.ToString(index));
            return(sourceElement);
        }
示例#2
0
        public void DeleteItemByRef(string name, string level)
        {
            ICsiContainer sourceElement = new CsiContainer(this.GetOwnerDocument(), "__listItem", this);

            sourceElement.SetAttribute("__listItemAction", "delete");
            CsiXmlHelper.FindCreateSetValue2(sourceElement, "__key", "__name", name, true);
            CsiXmlHelper.FindCreateSetValue3(sourceElement, "__key", "__level", "__name", level, true);
        }
示例#3
0
        public ICsiContainer AppendItem(string name, string level)
        {
            CsiContainer container = new CsiContainer(this.GetOwnerDocument(), "__listItem", this);

            container.SetAttribute("__listItemAction", "add");
            container.SetRef(name, level);
            return(container);
        }
示例#4
0
        public ICsiContainer GetItemByRef(string name, string level)
        {
            CsiContainer impl       = null;
            IEnumerator  enumerator = this.GetAllChildren().GetEnumerator();

            while (enumerator.MoveNext())
            {
                CsiObject current = enumerator.Current as CsiObject;
                impl = new CsiContainer(this.GetOwnerDocument(), current.GetDomElement());
                if ((level != null) && (level.Length == 0))
                {
                    level = null;
                }
                if (impl.Equals(name, level))
                {
                    return(impl);
                }
                impl = null;
            }
            return(impl);
        }