WriteBool() 공개 추상적인 메소드

public abstract WriteBool ( bool b ) : void
b bool
리턴 void
예제 #1
0
        private static void WriteDataObject(Serializer serializer, Type type, IDataObject dataObject, Message message)
        {
            if (!(dataObject is IObservableDataObject))
            {
                dataObject.Write(serializer);
                return;
            }

            var observable = (IObservableDataObject)dataObject;
            if(observable.IsReference)
                message.RemotingManager.ReferenceManager.Publish(observable);

            int referenceLocalId;
            if (!message.RemotingManager.ReferenceManager.TryGetLocalId(observable, out referenceLocalId))
                referenceLocalId = 0;

            serializer.WriteI32(referenceLocalId);

            ushort remoteContextId;
            ushort dataObjectId;
            var polymorphicType = message.RemotingManager.ContextManager.GetPeerPolymorphicType(message.Peer, dataObject.GetType(), type, out remoteContextId, out dataObjectId);
            var isPolymorphic = polymorphicType != type;
            serializer.WriteBool(isPolymorphic);
            if (isPolymorphic)
            {
                serializer.WriteI16((short)remoteContextId);
                serializer.WriteI16((short)dataObjectId);
            }

            dataObject.Write(serializer, polymorphicType);
        }