Ejemplo n.º 1
0
        public static ICsiXmlElement FindCreateSetValue2(ICsiXmlElement sourceElement, string firstLevelTag, string secondLevelTag, string val, bool isCdata)
        {
            ICsiXmlElement element = sourceElement.FindChildByName(firstLevelTag);

            if (element == null)
            {
                element = new CsiXmlElement(sourceElement.GetOwnerDocument(), firstLevelTag, sourceElement);
            }
            return(FindCreateSetValue(element, secondLevelTag, val, isCdata));
        }
Ejemplo n.º 2
0
        private void CreateConnect(string userName, string password, ICsiXmlElement parent)
        {
            ICsiDocument    document = parent.GetOwnerDocument();
            ICsiXmlElement  element  = new CsiXmlElement(document, "__connect", parent);
            ICsiNamedObject obj2     = new CsiNamedObject(document, "user", element);

            obj2.SetRef(userName);
            ICsiDataField field = new CsiDataField(document, "password", element);

            field.SetEncryptedValue(password);
        }
Ejemplo n.º 3
0
        private void CreateConnectWithoutPassword(string userName, string sessionId, ICsiXmlElement parent)
        {
            ICsiDocument    document = parent.GetOwnerDocument();
            ICsiXmlElement  element  = new CsiXmlElement(document, "__useSession", parent);
            ICsiNamedObject obj2     = new CsiNamedObject(document, "user", element);

            obj2.SetRef(userName);
            ICsiDataField field = new CsiDataField(document, "sessionId", element);

            field.SetAttribute("__encrypted", "no");
            field.SetValue(sessionId);
        }
Ejemplo n.º 4
0
        public static ICsiXmlElement FindCreateSetValue(ICsiXmlElement sourceElement, string tagName, string val, bool isCdata = false)
        {
            CsiXmlElement impl = (CsiXmlElement)sourceElement.FindChildByName(tagName);

            if (impl == null)
            {
                impl = new CsiXmlElement(sourceElement.GetOwnerDocument(), tagName, sourceElement);
            }
            if (!(!isCdata || StringUtil.IsEmptyString(val)))
            {
                SetCdataNode(impl.GetDomElement(), val);
                return(impl);
            }
            SetTextNode(impl.GetDomElement(), val);
            return(impl);
        }