Beispiel #1
0
 public string ToStringFull()
 {
     return(string.Format("OperationResponse {0}: ReturnCode: {1} ({3}). Parameters: {2}", new object[]
     {
         this.OperationCode,
         this.ReturnCode,
         SupportClass.DictionaryToString(this.Parameters),
         this.DebugMessage
     }));
 }
 public string ToStringFull()
 {
     return(string.Format("Event {0}: {1}", this.Code, SupportClass.DictionaryToString(this.Parameters)));
 }
 public static string HashtableToString(Hashtable hash)
 {
     return(SupportClass.DictionaryToString(hash));
 }
        public static string DictionaryToString(IDictionary dictionary, bool includeTypes)
        {
            bool   flag = dictionary == null;
            string result;

            if (flag)
            {
                result = "null";
            }
            else
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("{");
                foreach (object obj in dictionary.Keys)
                {
                    bool flag2 = stringBuilder.Length > 1;
                    if (flag2)
                    {
                        stringBuilder.Append(", ");
                    }
                    bool   flag3 = dictionary[obj] == null;
                    Type   type;
                    string text;
                    if (flag3)
                    {
                        type = typeof(object);
                        text = "null";
                    }
                    else
                    {
                        type = dictionary[obj].GetType();
                        text = dictionary[obj].ToString();
                    }
                    bool flag4 = typeof(IDictionary) == type || typeof(Hashtable) == type;
                    if (flag4)
                    {
                        text = SupportClass.DictionaryToString((IDictionary)dictionary[obj]);
                    }
                    bool flag5 = typeof(string[]) == type;
                    if (flag5)
                    {
                        text = string.Format("{{{0}}}", string.Join(",", (string[])dictionary[obj]));
                    }
                    if (includeTypes)
                    {
                        stringBuilder.AppendFormat("({0}){1}=({2}){3}", new object[]
                        {
                            obj.GetType().Name,
                            obj,
                            type.Name,
                            text
                        });
                    }
                    else
                    {
                        stringBuilder.AppendFormat("{0}={1}", obj, text);
                    }
                }
                stringBuilder.Append("}");
                result = stringBuilder.ToString();
            }
            return(result);
        }
 public static string DictionaryToString(IDictionary dictionary)
 {
     return(SupportClass.DictionaryToString(dictionary, true));
 }