GetType() public static method

public static GetType ( Type type ) : SirenType
type System.Type
return Medusa.Siren.Schema.SirenType
Ejemplo n.º 1
0
        public static ArraySegment <byte> Serialize(object obj)
        {
            var        writer     = new CompactBinaryWriter();
            Serializer serializer = new Serializer(writer);

            serializer.SerializeHelper(obj, SirenMachine.GetType(obj.GetType()));
            return(writer.ToBuffer());
        }
Ejemplo n.º 2
0
        public static T Deserialize <T>(ArraySegment <byte> data)
            where T : class, new()
        {
            var reader = new CompactBinaryReader();

            reader.Accept(data);
            Deserializer deserializer = new Deserializer(reader);

            object obj = new T();

            deserializer.DeserializeHelper(typeof(T), ref obj, SirenMachine.GetType(typeof(T)));
            return((T)obj);
        }