示例#1
0
 public static InvokeArgs From(AnyValue arg1, AnyValue arg2, AnyValue arg3, AnyValue arg4, AnyValue arg5)
 {
     return(new InvokeArgs()
     {
         Arg1 = arg1, Arg2 = arg2, Arg3 = arg3, Arg4 = arg4, Arg5 = arg5, Count = 5
     });
 }
示例#2
0
 public static InvokeArgs From(AnyValue arg1, AnyValue arg2, AnyValue arg3)
 {
     return(new InvokeArgs()
     {
         Arg1 = arg1, Arg2 = arg2, Arg3 = arg3, Count = 3
     });
 }
示例#3
0
 public static InvokeArgs From(AnyValue arg)
 {
     return(new InvokeArgs()
     {
         Arg1 = arg, Count = 1
     });
 }
示例#4
0
        private const byte                FromWebStream = 255; //仅存在于Host进程

        #region ====From Methods, 仅用于简化服务端编码====
        public static InvokeArgs From(BytesSegment last, int offset)
        {
            if (offset == -1)
            {
                return(Empty);
            }

            if (last.Next != null)
            {
                throw new ArgumentException(nameof(last));
            }
            return(new InvokeArgs
            {
                Count = FromWebSocket,
                Arg1 = AnyValue.From(last.First), //当前包,新建是指向第一包
                Arg2 = AnyValue.From(last),       //最后一包
                Postion = offset
            });
        }
示例#5
0
        internal void Set(int index, AnyValue value)
        {
            if (index < 0 && index > 4)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            switch (index)
            {
            case 0: Arg1 = value; break;

            case 1: Arg2 = value; break;

            case 2: Arg3 = value; break;

            case 3: Arg4 = value; break;

            case 4: Arg5 = value; break;
            }
        }