Beispiel #1
0
            public string DebugPrint(int Indent = 0)
            {
                string S, SIndent;

                SIndent = new string(' ', Indent * 11);

                S = "Node(Key=" + _Key.ToString() + "; Color=" + (_IsRed ? "red" : "black") + "; Count=" + _Count.ToString() + "; Data=" + _Data.ToString() + "\u000d\u000a";

                S += SIndent + "     Left =";
                if (_Left != null)
                {
                    S += _Left.DebugPrint(Indent + 1);
                }
                else
                {
                    S += "null";
                }

                S += "\u000d\u000a" + SIndent + "     Right=";
                if (_Right != null)
                {
                    S += _Right.DebugPrint(Indent + 1) + ")";
                }
                else
                {
                    S += "null)";
                }

                return(S);
            }
Beispiel #2
0
 /// <summary>
 /// Converts the provided <paramref name="id"/> to its string representation.
 /// </summary>
 /// <param name="id">The id to convert.</param>
 /// <returns>An <see cref="string"/> representation of the provided <paramref name="id"/>.</returns>
 public virtual string?ConvertIdToString(TKey id)
 {
     if (id.Equals(default(TKey)))
     {
         return(null);
     }
     return(id.ToString());
 }
Beispiel #3
0
            private string KeyToString(TKey key)
            {
                if (_keyConverter == null)
                {
                    return(key.ToString());
                }

                return((string)_keyConverter.Convert(key, typeof(string), null, CultureInfo.CurrentUICulture));
            }
 internal DictionaryPropertyDescriptor(
     TKey key,
     IDictionary <TKey, TValue> valueDictionary,
     IDictionary <TKey, PropertyAttributes> attributeDictionary = null)
     : base(key.ToString(), null)
 {
     this.valueDictionary     = valueDictionary;
     this.attributeDictionary = attributeDictionary;
     this.key = key;
 }
Beispiel #5
0
 public override string ToString()
 {
     return(key.ToString() + "," + value.ToString());
 }
Beispiel #6
0
 public override string ToString()
 {
     return(Key.ToString() + "   " + Value.ToString());
 }
Beispiel #7
0
 internal string ToString(int count)
 {
     return((right != null ? right.ToString(count + 4) : new string(' ', count + 4) + "+ null") + "\n" + new string(' ', count) + (isLeft ? "L" : "R") + " \"" + key.ToString() + "\" : \"" + value.ToString() + "\" (" + balance + " | L" + _depthL + "R" + _depthR + ") \n" + (left != null ? left.ToString(count + 4) : new string(' ', count + 4) + "+ null"));
 }