Esempio n. 1
0
        public bool HasCallbacks(TypeModel.CallbackType callbackType)

        {
            IProtoTypeSerializer pts = Tail as IProtoTypeSerializer;

            return(pts != null && pts.HasCallbacks(callbackType));
        }
        public bool HasCallbacks(TypeModel.CallbackType callbackType)
        {
            IProtoTypeSerializer tail = this.Tail as IProtoTypeSerializer;

            if (tail == null)
            {
                return(false);
            }
            return(tail.HasCallbacks(callbackType));
        }
Esempio n. 3
0
 public bool HasCallbacks(TypeModel.CallbackType callbackType)
 {
     return(_serializer.HasCallbacks(callbackType));
 }
Esempio n. 4
0
        public bool HasCallbacks(TypeModel.CallbackType callbackType)
        {
            IProtoTypeSerializer pts = DelegationHandler as IProtoTypeSerializer;

            return(pts != null && pts.HasCallbacks(callbackType));
        }
Esempio n. 5
0
        // Token: 0x06000275 RID: 629 RVA: 0x0000F434 File Offset: 0x0000D634
        public bool HasCallbacks(TypeModel.CallbackType callbackType)
        {
            IProtoTypeSerializer protoTypeSerializer = this.Tail as IProtoTypeSerializer;

            return(protoTypeSerializer != null && protoTypeSerializer.HasCallbacks(callbackType));
        }
Esempio n. 6
0
        public bool HasCallbacks(TypeModel.CallbackType callbackType)
        {
            IProtoTypeSerializer tail = base.Tail as IProtoTypeSerializer;

            return((tail != null) && tail.HasCallbacks(callbackType));
        }
Esempio n. 7
0
        public bool HasCallbacks(TypeModel.CallbackType callbackType)
        {
            IProtoTypeSerializer protoTypeSerializer = base.Tail as IProtoTypeSerializer;

            return(protoTypeSerializer?.HasCallbacks(callbackType) ?? false);
        }
Esempio n. 8
0
        void ProtoBuf.Serializers.IProtoTypeSerializer.EmitCallback(CompilerContext ctx, Local valueFrom, TypeModel.CallbackType callbackType)
        {
            MethodInfo item;
            bool       flag = false;

            if (this.CanHaveInheritance)
            {
                for (int i = 0; i < (int)this.serializers.Length; i++)
                {
                    IProtoSerializer protoSerializer = this.serializers[i];
                    if (protoSerializer.ExpectedType != this.forType && ((IProtoTypeSerializer)protoSerializer).HasCallbacks(callbackType))
                    {
                        flag = true;
                    }
                }
            }
            if (this.callbacks == null)
            {
                item = null;
            }
            else
            {
                item = this.callbacks[callbackType];
            }
            MethodInfo methodInfo = item;

            if (methodInfo == null && !flag)
            {
                return;
            }
            ctx.LoadAddress(valueFrom, this.ExpectedType);
            TypeSerializer.EmitInvokeCallback(ctx, methodInfo, flag, null, this.forType);
            if (flag)
            {
                CodeLabel codeLabel = ctx.DefineLabel();
                for (int j = 0; j < (int)this.serializers.Length; j++)
                {
                    IProtoSerializer protoSerializer1 = this.serializers[j];
                    Type             expectedType     = protoSerializer1.ExpectedType;
                    if (expectedType != this.forType)
                    {
                        IProtoTypeSerializer protoTypeSerializer  = (IProtoTypeSerializer)protoSerializer1;
                        IProtoTypeSerializer protoTypeSerializer1 = protoTypeSerializer;
                        if (protoTypeSerializer.HasCallbacks(callbackType))
                        {
                            CodeLabel codeLabel1 = ctx.DefineLabel();
                            CodeLabel codeLabel2 = ctx.DefineLabel();
                            ctx.CopyValue();
                            ctx.TryCast(expectedType);
                            ctx.CopyValue();
                            ctx.BranchIfTrue(codeLabel1, true);
                            ctx.DiscardValue();
                            ctx.Branch(codeLabel2, false);
                            ctx.MarkLabel(codeLabel1);
                            protoTypeSerializer1.EmitCallback(ctx, null, callbackType);
                            ctx.Branch(codeLabel, false);
                            ctx.MarkLabel(codeLabel2);
                        }
                    }
                }
                ctx.MarkLabel(codeLabel);
                ctx.DiscardValue();
            }
        }