private static TransportObjectContainer NewTransportObjectContainer(ObjectContainerBase serviceProvider, MemoryBin memoryBin) { TransportObjectContainer container = new TransportObjectContainer(serviceProvider , memoryBin); container.DeferredOpen(); return container; }
private static TransportObjectContainer NewTransportObjectContainer(ObjectContainerBase serviceProvider, MemoryBin memoryBin) { TransportObjectContainer container = new TransportObjectContainer(serviceProvider , memoryBin); container.DeferredOpen(); return(container); }
public static SerializedGraph Marshall(ObjectContainerBase serviceProvider, object obj) { MemoryBin memoryBin = new MemoryBin(223, GrowthStrategy()); TransportObjectContainer carrier = NewTransportObjectContainer(serviceProvider, memoryBin ); carrier.ProduceClassMetadata(carrier.Reflector().ForObject(obj)); carrier.Store(obj); int id = (int)carrier.GetID(obj); carrier.Close(); return(new SerializedGraph(id, memoryBin.Data())); }
public static object Unmarshall(ObjectContainerBase serviceProvider, byte[] bytes , int id) { if (id <= 0) { return(null); } MemoryBin memoryBin = new MemoryBin(bytes, GrowthStrategy()); TransportObjectContainer carrier = NewTransportObjectContainer(serviceProvider, memoryBin ); object obj = carrier.GetByID(id); carrier.Activate(carrier.Transaction, obj, new FullActivationDepth()); carrier.Close(); return(obj); }