示例#1
0
        public LocalBuilder AddLocal(IKType type)
        {
            if (il == null)
                il = builder.GetILGenerator();

            return il.DeclareLocal(type);
        }
示例#2
0
 public SubItemSerializer(Type type, int key, ISerializerProxy proxy, bool recursionCheck)
 {
     if (type == null) throw new ArgumentNullException("type");
     if (proxy == null) throw new ArgumentNullException("proxy");
     this.type = type;
     this.proxy= proxy;
     this.key = key;
     this.recursionCheck = recursionCheck;
 }
示例#3
0
		void IProtoSerializer.Write(Type useType, object value, ProtoWriter dest)
        {
            if (recursionCheck)
            {
                ProtoWriter.WriteObject(value, key, dest);
            }
            else
            {
                ProtoWriter.WriteRecursionSafeObject(value, key, dest);
            }
        }
示例#4
0
 private Local(LocalBuilder value, Type type)
 {
     this.value = value;
     this.type = type;
 }
示例#5
0
 internal Local(Compiler.CompilerContext ctx, Type type)
 {
     this.ctx = ctx;
     if (ctx != null) { value = ctx.GetFromPool(type); }
     this.type = type;
 }
示例#6
0
 internal int GetTypeKey(ref Type type)
 {
     return model.GetKey(ref type);
 }
示例#7
0
 public static Instruction Create(OpCode opcode, IKType type)
 {
     Instruction i = new Instruction();
     i.opCode = opcode;
     i.type = InstructionType.OpCode;
     i.operand = type;
     i.operandType = typeof(IKType);
     return i;
 }
示例#8
0
 public void Emit(OpCode opcode, IKType type)
 {
     Append(Instruction.Create(opcode, type));
 }
示例#9
0
 internal int GetTypeKey(ref Type type)
 {
     return(model.GetKey(ref type));
 }
示例#10
0
        public GuidSerializer(ProtoBuf.Meta.TypeModel model)
        {
#if FEAT_IKVM
            expectedType = model.MapType(typeof(Guid));
#endif
        }
示例#11
0
		object IProtoSerializer.Read(Type useType, object value, ProtoReader source)
        {
            return ProtoReader.ReadObject(value, key, source);
        }
示例#12
0
		void IProtoTypeSerializer.Callback(Type useType, object value, TypeModel.CallbackType callbackType, SerializationContext context)
        {
            ((IProtoTypeSerializer)proxy.Serializer).Callback(useType, value, callbackType, context);
        }