Esempio n. 1
0
        public ICsiRequestField RequestField(string fieldName)
        {
            ICsiRequestField impl = base.FindChildByName(fieldName) as CsiRequestField;

            if (impl == null)
            {
                impl = new CsiRequestField(this.GetOwnerDocument(), fieldName, this);
            }
            return(impl);
        }
Esempio n. 2
0
        public ICsiRequestField RequestListItemByIndex(int index, string fieldName, string cdoTypeName)
        {
            if (index < 0)
            {
                string src = base.GetType().FullName + ".requestListItemByIndex()";
                throw new CsiClientException(0x2e001aL, src);
            }
            CsiXmlElement parent     = null;
            IEnumerator   enumerator = base.GetChildrenByName("__listItem").GetEnumerator();

            while (enumerator.MoveNext())
            {
                parent = enumerator.Current as CsiXmlElement;
                if (int.Parse(parent.GetAttribute("__index")) == index)
                {
                    break;
                }
                parent = null;
            }
            if (parent == null)
            {
                parent = new CsiXmlElement(this.GetOwnerDocument(), "__listItem", this);
                parent.SetAttribute("__index", Convert.ToString(index));
            }
            CsiXmlElement child = parent;

            if (!StringUtil.IsEmptyString(fieldName) && (fieldName != null))
            {
                child = base.FindChildByName(fieldName) as CsiXmlElement;
                if (child != null)
                {
                    base.RemoveChild(child);
                }
                child = new CsiRequestField(this.GetOwnerDocument(), fieldName, parent);
                parent.AppendChild(child);
            }
            return(child as ICsiRequestField);
        }
        protected ICsiRequestField RequestForField(string fieldName)
        {
            CsiRequestField child = null;

            string[]      stringList = StringUtil.GetStringList(fieldName, '.');
            CsiXmlElement parent     = this;

            for (int i = 0; i < stringList.Length; i++)
            {
                XmlElement requestField = this.GetElement(parent.GetDomElement(), stringList[i]);
                if (requestField != null)
                {
                    child = new CsiRequestField(this.GetOwnerDocument(), requestField);
                }
                else
                {
                    child = new CsiRequestField(this.GetOwnerDocument(), stringList[i], parent);
                    parent.AppendChild(child);
                }
                parent = child;
            }
            return(child);
        }
 public CsiSelectionValues(ICsiDocument csiDocument, CsiRequestField csiRequestField)
 {
     this.csiDocument     = csiDocument;
     this.csiRequestField = csiRequestField;
 }