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

            return il.DeclareLocal(type);
        }
Beispiel #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;
 }
Beispiel #3
0
		void IProtoSerializer.Write(Type useType, object value, ProtoWriter dest)
        {
            if (recursionCheck)
            {
                ProtoWriter.WriteObject(value, key, dest);
            }
            else
            {
                ProtoWriter.WriteRecursionSafeObject(value, key, dest);
            }
        }
Beispiel #4
0
 private Local(LocalBuilder value, Type type)
 {
     this.value = value;
     this.type = type;
 }
Beispiel #5
0
 internal Local(Compiler.CompilerContext ctx, Type type)
 {
     this.ctx = ctx;
     if (ctx != null) { value = ctx.GetFromPool(type); }
     this.type = type;
 }
Beispiel #6
0
 internal int GetTypeKey(ref Type type)
 {
     return model.GetKey(ref type);
 }
Beispiel #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;
 }
Beispiel #8
0
 public void Emit(OpCode opcode, IKType type)
 {
     Append(Instruction.Create(opcode, type));
 }
Beispiel #9
0
 internal int GetTypeKey(ref Type type)
 {
     return(model.GetKey(ref type));
 }
Beispiel #10
0
        public GuidSerializer(ProtoBuf.Meta.TypeModel model)
        {
#if FEAT_IKVM
            expectedType = model.MapType(typeof(Guid));
#endif
        }
Beispiel #11
0
		object IProtoSerializer.Read(Type useType, object value, ProtoReader source)
        {
            return ProtoReader.ReadObject(value, key, source);
        }
Beispiel #12
0
		void IProtoTypeSerializer.Callback(Type useType, object value, TypeModel.CallbackType callbackType, SerializationContext context)
        {
            ((IProtoTypeSerializer)proxy.Serializer).Callback(useType, value, callbackType, context);
        }