/// <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(); }
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(); }
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(); }
public static bool LoadFromFile(string fileName, out parameters obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); }
/// <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; } }
public static bool Deserialize(string xml, out parameters obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); }
/// <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; } }