コード例 #1
0
 /// <summary>
 /// Converts the string representation of a ErrorCodeResponse to its
 /// struct equivalent. A return value indicates whether the
 /// operation succeeded.
 /// </summary>
 /// <param name="input">A string to convert.</param>
 /// <param name="value">
 /// When this method returns, contains the struct equivalent of the value contained
 /// in input, if the conversion succeeded, or default(ErrorCodeResponse) if the conversion
 /// failed. The conversion fails if the input parameter is null or String.Empty, or is
 /// not of the correct format. This parameter is passed uninitialized.
 /// </param>
 /// <returns>True if input was converted successfully; otherwise, false.</returns>
 public unsafe static bool TryParse(string input, out ErrorCodeResponse value)
 {
     try
     {
         value = Newtonsoft.Json.JsonConvert.DeserializeObject <ErrorCodeResponse>(input);
         return(true);
     }
     catch { value = default(ErrorCodeResponse); return(false); }
 }
コード例 #2
0
        private static void ToString_impl(ErrorCodeResponse value, StringBuilder str_builder, bool in_json)
        {
            {
                str_builder.Append('{');
                bool first_field = true;

                {
                    if (first_field)
                    {
                        first_field = false;
                    }
                    else
                    {
                        str_builder.Append(',');
                    }
                    str_builder.Append("\"errno\":");

                    ToString_impl(value.errno, str_builder, in_json: true);
                }

                str_builder.Append('}');
            }
        }
コード例 #3
0
 /// <summary>
 /// Serializes a ErrorCodeResponse object to Json string.
 /// </summary>
 /// <param name="value">The target object to be serialized.</param>
 /// <returns>The serialized Json string.</returns>
 public static string ToString(ErrorCodeResponse value)
 {
     s_ensure_string_builder();
     ToString_impl(value, s_stringBuilder, in_json: false);
     return(s_stringBuilder.ToString());
 }