Example #1
0
        public override void FillBox(Box box, object o, Mapper mapper)
        {
            // we store the id of the type message in an uint
            var valueBox = new ScalarValueBox();

            valueBox.ULong = mapper.GetTypeMetadataId((Type)o, null); // don't change the transformer that is used for objects / boxes of this type!
            box.Value      = valueBox;
        }
Example #2
0
 protected override void Populate(Box box, bool value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.ULong = Convert.ToUInt64(value); box.Value = b;
 }
Example #3
0
 protected override void Populate(Box box, string value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.ULong = mapper.GetStringId(value); box.Value = b;
 }
Example #4
0
 protected override void Populate(Box box, TimeSpan value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.Long = value.Ticks; box.Value = b;
 }
Example #5
0
 protected override void Populate(Box box, char value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.ULong = value; box.Value = b;
 }
Example #6
0
 protected override void Populate(Box box, double value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.Double = value; box.Value = b;
 }
Example #7
0
 protected override void Populate(Box box, float value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.Float = value; box.Value = b;
 }
 protected override void Populate(Box box, Guid value, Mapper mapper)
 {
     var b = new ScalarValueBox(); b.Bytes = ByteString.CopyFrom(value.ToByteArray()); box.Value = b;
 }