Ejemplo n.º 1
0
        public static String DataString <T>(this IInstanceSerializer <T> instanceSerializer, T instance, StringBuilder builder)
        {
            builder.Length = 0;
            instanceSerializer.DataString(instance, builder);
            String dataString = builder.ToString();

            builder.Length = 0;
            return(dataString);
        }
Ejemplo n.º 2
0
        public override void DataString(Object instance, StringBuilder builder)
        {
            Object valueAsObject = fieldInfo.GetValue(instance);

            if (valueAsObject == null)
            {
                builder.Append("null");
                return;
            }

            ElementType[] valueAsArray = (ElementType[])valueAsObject;
            builder.Append('[');
            for (int i = 0; i < valueAsArray.Length; i++)
            {
                elementSerializer.DataString(valueAsArray[i], builder);
            }
            builder.Append(']');
        }
Ejemplo n.º 3
0
 public void DataString(StringBuilder builder)
 {
     serializer.DataString(instance, builder);
 }