示例#1
0
 private T GetValue <T> (FlattenedSerializationReader <T> reader)
 {
     try
     {
         return(reader.ReadValue());
     }
     catch (InvalidOperationException ex)
     {
         throw new SerializationException(typeof(T).Name + " stream: " + ex.Message, ex);
     }
 }
示例#2
0
        public FlattenedDeserializationInfo(object[] data)
        {
            ArgumentUtility.CheckNotNull("data", data);
            object[] objects = ArgumentUtility.CheckType <object[]> ("data[0]", data[0]);
            int[]    ints    = ArgumentUtility.CheckType <int[]> ("data[1]", data[1]);
            bool[]   bools   = ArgumentUtility.CheckType <bool[]> ("data[2]", data[2]);

            _objectReader = new FlattenedSerializationReader <object> (objects);
            _intReader    = new FlattenedSerializationReader <int> (ints);
            _boolReader   = new FlattenedSerializationReader <bool> (bools);
        }