Esempio n. 1
0
        /// <summary>
        /// Convert parameter list to json object
        /// </summary>
        public static string parameterFieldMapJson(parameters parms, string ProjectID, string QueryID)
        {
            StringWriter sw = new StringWriter();
            JsonTextWriter json = new JsonTextWriter(sw);

            json.WriteStartObject();
            json.WritePropertyName("results");
            json.WriteStartArray();
            json.WriteStartObject();
            // ProjectID and QueryID
            json.WritePropertyName("ProjectID");
            json.WriteValue(ProjectID);
            json.WritePropertyName("QueryID");
            json.WriteValue(QueryID);

            json.WritePropertyName("parameters");
            json.WriteRawValue(JsonConvert.SerializeObject(parms));

            json.WriteEndObject();
            json.WriteEndArray();
            json.WriteEndObject();

            json.Flush();
            sw.Flush();

            return sw.ToString();
        }
Esempio n. 2
0
            private static void getParameterJsonStringArray(JsonTextWriter json, parameters parameters)
            {
                json.WriteStartObject();

                foreach (parameter schemaParm in parameters.parameter)
                {

                    json.WritePropertyName(schemaParm.name);
                    json.WriteValue(Helper.FlattenList(schemaParm.Text));

                }
                json.WriteEndObject();
            }
Esempio n. 3
0
 public QueryType()
 {
     this.subqueryField = new subquery();
     this.actionsField = new List<action>();
     this.pagingField = new paging();
     this.fieldsField = new List<field>();
     this.parametersField = new parameters();
     this.commandField = new command();
 }
Esempio n. 4
0
 public static bool LoadFromFile(string fileName, out parameters obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
Esempio n. 5
0
 /// <summary>
 /// Deserializes xml markup from file into an parameters object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output parameters object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out parameters obj, out System.Exception exception)
 {
     exception = null;
     obj = default(parameters);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
Esempio n. 6
0
 public static bool Deserialize(string xml, out parameters obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
Esempio n. 7
0
 /// <summary>
 /// Deserializes workflow markup into an parameters object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output parameters object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out parameters obj, out System.Exception exception)
 {
     exception = null;
     obj = default(parameters);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }