コード例 #1
0
        public virtual void write(object obj, IProtocolFormatter formatter)
        {
            ReferenceCache referenceCache = formatter.GetReferenceCache();
            DateTime       date           = (DateTime)obj;
            int            refId          = referenceCache.GetObjectId(date.ToUniversalTime());

            if (refId != -1)
            {
                formatter.WriteDateReference(refId);
            }
            else
            {
                referenceCache.AddObject(date.ToUniversalTime());
                formatter.getContextWriter().write(obj, formatter);
            }
        }
コード例 #2
0
        public virtual void write( object obj, IProtocolFormatter formatter )
        {
            ReferenceCache referenceCache = formatter.GetReferenceCache();
            DateTime date = (DateTime) obj;
            int refId = referenceCache.GetObjectId( date.ToUniversalTime() );

            if( refId != -1 )
            {
                formatter.WriteDateReference( refId );
            }
            else
            {
                referenceCache.AddObject( date.ToUniversalTime() );
                formatter.getContextWriter().write( obj, formatter );
            }
        }