Пример #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);
        }