예제 #1
0
 public void BeginElement(
     string name,
     UnknownObjectReader value,
     string[] attributeNames,
     object[] attributeValues)
 {
     foreach (string resolvedElement in this._ResolvedElements)
     {
         this._Writer.WriteStartElement(resolvedElement);
     }
     this._ResolvedElements.Clear();
     this._Writer.WriteStartElement(name);
     if (attributeNames != null && attributeValues != null)
     {
         int num = 0;
         foreach (string attributeName in attributeNames)
         {
             this._Writer.WriteAttributeString(attributeName, attributeValues[num++].ToString());
         }
     }
     if (value == null)
     {
         return;
     }
     if (value.Value is string || value.Value is IPrimitive)
     {
         if (value.Value is PasswordFieldType)
         {
             this._Writer.WriteAttributeString("__encrypted", "yes");
             this._Writer.WriteCData(CryptUtil.Encrypt(value.Value.ToString()));
         }
         else
         {
             this._Writer.WriteCData(value.Value.ToString());
         }
     }
     else if (value.Value is EncryptedField)
     {
         this._Writer.WriteAttributeString("__encrypted", "yes");
         EncryptedField encryptedField = value.Value as EncryptedField;
         if (encryptedField.IsEncrypted)
         {
             this._Writer.WriteCData(encryptedField.Value);
         }
         else
         {
             this._Writer.WriteCData(CryptUtil.Encrypt(encryptedField.Value));
         }
     }
     else
     {
         this._Writer.WriteCData(value.Value.ToString().ToLower());
     }
 }
예제 #2
0
 public UnknownObjectReader this[string name]
 {
     get
     {
         UnknownObjectReader unknownObjectReader = (UnknownObjectReader)null;
         foreach (UnknownObjectReader field in this.GetFields())
         {
             if (field._Name == name)
             {
                 unknownObjectReader = field;
             }
         }
         return(unknownObjectReader);
     }
 }
예제 #3
0
        public void CallServiceMethods(
            Method[] methods,
            Request request,
            Result result,
            ResultStatus resultStatus)
        {
            resultStatus.IsSuccess = true;
            this._inSiteXmlParser.SetService();
            foreach (object method in methods)
            {
                UnknownObjectReader unknownObjectReader = new UnknownObjectReader(method);
                string empty = string.Empty;
                if (unknownObjectReader["ServiceMethod"] != null)
                {
                    empty = unknownObjectReader["ServiceMethod"].Value.ToString();
                }
                DCObject cdo = (DCObject)null;
                if (unknownObjectReader["Cdo"] != null)
                {
                    cdo = unknownObjectReader["Cdo"].Value as DCObject;
                }
                Parameters parameters = (Parameters)null;
                if (unknownObjectReader["Parameters"] != null)
                {
                    parameters = unknownObjectReader["Parameters"].Value as Parameters;
                }
                this._inSiteXmlParser.ToXmlAsMethodCall(empty, cdo, parameters);
            }
            this._inSiteXmlParser.SetRequest(request);
            string empty1 = string.Empty;

            this._serverConnection.InboundXML = this._inSiteXmlParser.GetXmlAsString();
            this._Log.WriteXml("Methods", this._serverConnection.InboundXML, true, resultStatus);
            string str = this._serverConnection.Submit();

            this._Log.WriteXml("Methods", str, false, resultStatus);
            this._inSiteXmlParser.ToObjectsAsMethodCall(str, result, resultStatus);
        }
예제 #4
0
 private int MethodComparer(UnknownObjectReader x, UnknownObjectReader y)
 {
     return(x.Name == "Level" ? 1 : string.Compare(x.Name, y.Name));
 }
예제 #5
0
 public void BeginElement(string name, UnknownObjectReader value)
 {
     this.BeginElement(name, value, (string[])null, (object[])null);
 }