示例#1
0
        public void SerializeConstructor(ref object value, ISerializationWriter writer)
        {
            Array array = (Array)value;

            int[] lengths = new int[array.Rank];
            for (int i = 0; i < array.Rank; ++i)
            {
                lengths[i] = array.GetLength(i);
            }

            writer.WriteSet(typeof(int), "Length", lengths);
        }
示例#2
0
 public void SerializeContents(ref object value, ISerializationWriter writer)
 {
     writer.WriteSet <T>(SerializationConstants.DefaultValueItemName, (LinkedList <T>)value);
 }
示例#3
0
 public void SerializeContents(ref object value, ISerializationWriter writer)
 {
     writer.WriteSet(_elementType, SerializationConstants.DefaultValueItemName, (Array)value);
 }
 public void SerializeContents(ref object value, ISerializationWriter writer)
 {
     writer.WriteSet <KeyValuePair <TKey, TValue> >("Item", (Dictionary <TKey, TValue>)value);
 }
 public static void WriteSet <T>(this ISerializationWriter writer, string itemName, IEnumerable set)
 {
     writer.WriteSet(typeof(T), itemName, set);
 }