Exemplo n.º 1
0
        public static string ToString(int[] a, IToStringConverter <int> format)
        {
            if (a == null)
            {
                return("null");
            }
            int iMax = a.Length - 1;

            if (iMax == -1)
            {
                return("[]");
            }

            var b = new StringBuilder();

            b.Append('[');
            for (int i = 0; ; i++)
            {
                b.Append(format.ToString(a[i]));
                if (i == iMax)
                {
                    return(b.Append(']').ToString());
                }
                b.Append(", ");
            }
        }
Exemplo n.º 2
0
 public ToStringConvertAttribute(Type converterType)
 {
     Converter = (IToStringConverter)Activator.CreateInstance(converterType);
 }
Exemplo n.º 3
0
 public TimeConverter(IToStringConverter converter)
 {
     _converter = converter;
 }