Exemplo n.º 1
0
		public virtual void WriteTypeInfo(IWriteContext context, ArrayInfo info)
		{
			BitMap4 typeInfoBitmap = new BitMap4(2);
			typeInfoBitmap.Set(0, info.Primitive());
			typeInfoBitmap.Set(1, info.Nullable());
			context.WriteByte(typeInfoBitmap.GetByte(0));
		}
        // ITypeHandler4 override
        public override void Write(IWriteContext context, object obj)
        {
            // Write the data.
            var cfi = (CustomFieldInfo)obj;

            context.WriteInt(cfi.m_flid);
            context.WriteInt((int)cfi.m_fieldType);
            context.WriteInt(cfi.m_destinationClass);
            var cvtr  = new UnicodeEncoding();
            var bytes = cvtr.GetBytes(cfi.m_classname);

            context.WriteInt(bytes.Length);
            context.WriteBytes(bytes);
            bytes = cvtr.GetBytes(cfi.m_fieldname);
            context.WriteInt(bytes.Length);
            context.WriteBytes(bytes);
            if (cfi.m_fieldname != cfi.Label)
            {
                // marker to distinguish this from any other optional info we may one day write,
                // and from cases where no label is written.
                context.WriteByte(1);
                bytes = cvtr.GetBytes(cfi.Label);
                context.WriteInt(bytes.Length);
                context.WriteBytes(bytes);
            }
            if (!String.IsNullOrEmpty(cfi.m_fieldHelp))
            {
                context.WriteByte(2);
                bytes = cvtr.GetBytes(cfi.m_fieldHelp);
                context.WriteInt(bytes.Length);
                context.WriteBytes(bytes);
            }
            if (cfi.m_fieldListRoot != Guid.Empty)
            {
                context.WriteByte(3);
                bytes = cfi.m_fieldListRoot.ToByteArray();
                context.WriteInt(bytes.Length);
                context.WriteBytes(bytes);
            }
            if (cfi.m_fieldWs != 0)
            {
                context.WriteByte(4);
                context.WriteInt(cfi.m_fieldWs);
            }
            // End marker
            context.WriteByte(0);
        }
Exemplo n.º 3
0
        public virtual void WriteTypeInfo(IWriteContext context, ArrayInfo info)
        {
            BitMap4 typeInfoBitmap = new BitMap4(2);

            typeInfoBitmap.Set(0, info.Primitive());
            typeInfoBitmap.Set(1, info.Nullable());
            context.WriteByte(typeInfoBitmap.GetByte(0));
        }
Exemplo n.º 4
0
 public override void Write(IWriteContext context, object obj)
 {
     context.WriteByte(GetEncodedByteValue(obj));
 }
Exemplo n.º 5
0
 public override void Write(IWriteContext context, object obj)
 {
     context.WriteByte((byte)(((sbyte)obj) + 128));
 }
Exemplo n.º 6
0
 public override void Write(IWriteContext context, object obj)
 {
     context.WriteByte((byte)(((sbyte)obj) + 128));
 }
Exemplo n.º 7
0
		public override void Write(IWriteContext context, object obj)
		{
			context.WriteByte(GetEncodedByteValue(obj));
		}