Ejemplo n.º 1
0
 public override void write(POxOPrimitiveEncoder encoder, Object value)
 {
     try
     {
         if (canBeNull)
         {
             if (value == null)
             {
                 encoder.writeByte(0x00);
                 return;
             }
             else
             {
                 encoder.writeByte(0x01);
             }
         }
         encoder.writebool((bool)value);
     }
     catch (NotSupportedException e)
     {
         throw new POxOSerializerException("Error during Date serializing.", e);
     }
     catch (ObjectDisposedException e)
     {
         throw new POxOSerializerException("Error during Date serializing.", e);
     }
 }
Ejemplo n.º 2
0
    public override void write(POxOPrimitiveEncoder encoder, Object value)
    {
        try
        {
            if (canBeNull)
            {
                if (value == null)
                {
                    encoder.writeByte(0x00);
                    return;
                }
                else
                {
                    encoder.writeByte(0x01);
                }
            }

            long longValue = ((DateTime)value).ToFileTime();
            encoder.writeLong(longValue, true);
        }
        catch (ObjectDisposedException e)
        {
            throw new POxOSerializerException("Error during Date serializing.", e);
        }
        catch (NotSupportedException e)
        {
            throw new POxOSerializerException("Error during Date serializing.", e);
        }
    }