• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# OperationCode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OperationCode的典型用法代码示例。如果您正苦于以下问题:C# OperationCode类的具体用法?C# OperationCode怎么用?C# OperationCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OperationCode类属于命名空间,在下文中一共展示了OperationCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IndexViewModel

        public IndexViewModel()
        {
            ConsentValidFromStart = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            ConsentValidFromEnd = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            ConsentValidToStart = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            ConsentValidToEnd = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            NotificationReceivedStart = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            NotificationReceivedEnd = new OptionalDateInputViewModel(allowPastDates: true, showLabels: false);
            NotificationTypes = new SelectList(EnumHelper.GetValues(typeof(NotificationType)), dataTextField: "Value", dataValueField: "Key");
            TradeDirections = new SelectList(EnumHelper.GetValues(typeof(TradeDirection)), dataTextField: "Value", dataValueField: "Key");
            InterimStatus = new SelectList(new[]
            {
                new SelectListItem
                {
                    Text = "Interim",
                    Value = "true"
                },
                new SelectListItem
                {
                    Text = "Non-interim",
                    Value = "false"
                }
            }, dataTextField: "Text", dataValueField: "Value");
            OperationCodes = new MultiSelectList(EnumHelper.GetValues(typeof(OperationCode)), dataTextField: "Value", dataValueField: "Key");

            NotificationStatuses = new SelectList(GetCombinedNotificationStatuses(), dataTextField: "Name", dataValueField: "StatusId", dataGroupField: "TradeDirection", selectedValue: null);

            SelectedOperationCodes = new OperationCode[] { };
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:29,代码来源:IndexViewModel.cs


示例2: RegisterController

 public void RegisterController(OperationCode opCode,ControllerBase controll)
 {
     if (!controllers.ContainsKey((byte)opCode))
     {
         controllers.Add((byte)opCode, controll);
     }
 }
开发者ID:1510649869,项目名称:ARPG_project,代码行数:7,代码来源:PhotonEngine.cs


示例3: RegisterController

 //用于注册Controller的方法
 public void RegisterController(OperationCode opCode, ControllerBase controller)
 {
     controllers.Add((byte) opCode, controller);
     //if (!controllers.ContainsKey((byte) opCode))
     //{
     //    controllers.Add((byte) opCode, controller);
     //}
 }
开发者ID:vin120,项目名称:TaiDou,代码行数:9,代码来源:PhotonEngine.cs


示例4: Operation_Code_Is_Correctly_Deserialized

        public void Operation_Code_Is_Correctly_Deserialized(byte[] flagBytes, OperationCode expectedValue)
        {
            var bytes = _headerBytes.WithFlagBytes(flagBytes).ToArray();

            var message = _serializer.DeserializeFromBytes(bytes);

            Assert.That(message.OperationCode, Is.EqualTo(expectedValue));
        }
开发者ID:BenjaminRicketts,项目名称:DotNetDns,代码行数:8,代码来源:MessageSerializerTests.cs


示例5: GetOperationCodes

        public static OperationCode[] GetOperationCodes()
        {
            var values = Enum.GetValues(typeof(OperationCode));
            var result = new OperationCode[values.Length - BUILTIN_OPCODES_INDEX];
            for (int i = BUILTIN_OPCODES_INDEX, j = 0; i < values.Length; i++, j++)
            {
                result[j] = (OperationCode)values.GetValue(i);
            }

            return result;
        }
开发者ID:Shemetov,项目名称:OneScript,代码行数:11,代码来源:BuiltinFunctions.cs


示例6: ParametersInfo

        public static ParameterDefinition[] ParametersInfo(OperationCode funcOpcode)
        {
            ParameterDefinition[] info;
            if(!_paramInfoCache.TryGetValue(funcOpcode, out info))
            {
                info = _paramInfoGenerators[funcOpcode]();
                _paramInfoCache.Add(funcOpcode, info);
            }

            return info;
        }
开发者ID:pauliv2,项目名称:OneScript,代码行数:11,代码来源:BuiltinFunctions.cs


示例7: GetName

 public static string GetName(OperationCode OperationEnum)
 {
     switch (OperationEnum)
     {
         case OperationCode.BootRequest:
             return "BootRequest";
         case OperationCode.BootReply:
             return "BootReply";
         default:
             return "Unknown";
     }
 }
开发者ID:marinehero,项目名称:microserver,代码行数:12,代码来源:OperationCode.cs


示例8: OperationRequest

        public OperationRequest(DataPhaseInfo dpi, OperationCode ope, UInt32 tid, 
			UInt32 param1 = 0, UInt32 param2 = 0, UInt32 param3 = 0, UInt32 param4 = 0, UInt32 param5 = 0)
        {
            DataPhaseInfo = dpi;
            OperationCode = ope;
            TransactionID = tid;
            Parameter1 = param1;
            Parameter2 = param2;
            Parameter3 = param3;
            Parameter4 = param4;
            Parameter5 = param5;
            PacketType = PacketType.OperationRequest;
        }
开发者ID:kon0524,项目名称:Ev3Theta,代码行数:13,代码来源:OperationRequest.cs


示例9: operationRequest

        public OperationResponse operationRequest(
            DataPhaseInfo dpi, OperationCode code, UInt32 tid,
            UInt32 param1 = 0, UInt32 param2 = 0, UInt32 param3 = 0, UInt32 param4 = 0, UInt32 param5 = 0)
        {
            OperationRequest request = new OperationRequest(
                dpi, code, tid, param1, param2, param3, param4, param5);
            request.send(cmdStream);

            OperationResponse response = new OperationResponse();
            response.recv(cmdStream);

            return response;
        }
开发者ID:kon0524,项目名称:Ev3Theta,代码行数:13,代码来源:CmdDataConnection.cs


示例10: TransmitRequest

        //用来转发请求
        public static void TransmitRequest(ClientPeer peer, OperationRequest request,OperationCode opCode)
        {
            foreach (ClientPeer temp in peer.Team.clientPeers)
            {
                if (temp != peer)
                {
                    EventData data = new EventData();
                    data.Parameters = request.Parameters;
                    ParameterTool.AddOperationcodeSubcodeRoleID(data.Parameters, opCode, peer.LoginRole.ID);
                    temp.SendEvent(data, new SendParameters());
                }

            }
        }
开发者ID:vin120,项目名称:TaiDouServer,代码行数:15,代码来源:RequestTool.cs


示例11: GetCodeType

        public static NotificationType GetCodeType(OperationCode operationCode)
        {
            var attribute = typeof(OperationCode).GetField(operationCode.ToString())
                .GetCustomAttribute<OperationCodeTypeAttribute>(false);
            
            if (attribute == null)
            {
                throw new InvalidOperationException("Operation Code " 
                    + operationCode 
                    + " does not provide a Operation Code type attribute.");
            }

            return attribute.OperationType;
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:14,代码来源:OperationCodeMetadata.cs


示例12: ProcessOperationRequest

 public void ProcessOperationRequest(OperationCode code, IDictionary<byte, object> parameters)
 {
     if (code == OperationCode.HandleOperation)
     {
         _service.HandleOperation(_reader.ReadOperation(parameters));
     }
     else if (code == OperationCode.HandleOperationWithResponse)
     {
         _service.HandleOperationWithResponse(_reader.ReadOperation(parameters), _reader.ReadPromiseId(parameters));
     }
     else if (code == OperationCode.HandleResponse)
     {
         _service.HandleResponse(_reader.ReadResponse(parameters));
     }
 }
开发者ID:rioter00,项目名称:Project-Ethos,代码行数:15,代码来源:OperationProcessor.cs


示例13: LogOperationAsync

        public async Task<int> LogOperationAsync(int cardId, decimal amount, OperationCode code, DateTime date)
        {
            var operation = new Operation
                            {
                                CardId = cardId,
                                Amount = amount,
                                Code = code,
                                Date = date
                            };

            _context.Operations.Add(operation);

            await _context.SaveChangesAsync();

            return operation.Id;
        }
开发者ID:davidich,项目名称:CashMachine,代码行数:16,代码来源:OperationRepository.cs


示例14: operationRequest

        public ResponseCode operationRequest(
            DataPhaseInfo dpi, OperationCode code, UInt32 tid,
            UInt32 param1 = 0, UInt32 param2 = 0, UInt32 param3 = 0, UInt32 param4 = 0, UInt32 param5 = 0)
        {
            // OperationRequestを送信
            byte[] data = operationRequestData(dpi, code, tid, param1, param2, param3, param4, param5);
            stream.Write(data, 0, data.Length);

            // データフェーズがあれば送信(未実装)
            if (dpi == DataPhaseInfo.DataOutPhase)
            {
                sendDataPhase(tid);
            }

            // データを受信
            data = recvAllData();
            UInt32 length = BitConverter.ToUInt32(data, 0);
            PacketType pt = (PacketType)BitConverter.ToUInt32(data, 4);

            // データフェーズがあれば受信する
            if (pt == PacketType.StartData)
            {
                // 全データサイズ
                UInt64 tlen = BitConverter.ToUInt64(data, 12);
                recvData = new byte[tlen];
                int recvDataCount = 0;
                do
                {
                    data = recvAllData();
                    length = BitConverter.ToUInt32(data, 0);
                    pt = (PacketType)BitConverter.ToUInt32(data, 4);
                    Array.Copy(data, 12, recvData, recvDataCount, length - 12);
                    recvDataCount += (int)length - 12;
                }
                while (pt != PacketType.EndData);

                data = recvAllData();
                length = BitConverter.ToUInt32(data, 0);
                pt = (PacketType)BitConverter.ToUInt32(data, 4);
            }

            return (ResponseCode)BitConverter.ToUInt16(data, 8);
        }
开发者ID:kon0524,项目名称:DotNetThetaLib,代码行数:43,代码来源:CmdDataConnection.cs


示例15: ParseBinaryOperation

 private Expression ParseBinaryOperation(OperationCode currentOpcode)
 {
     switch (currentOpcode) {
     default:
       Debug.Assert(false);
       goto case OperationCode.Xor;
     case OperationCode.Add:
     case OperationCode.Add_Ovf:
     case OperationCode.Add_Ovf_Un:
       return this.ParseAddition(currentOpcode);
     case OperationCode.And:
       return this.ParseBinaryOperation(new BitwiseAnd());
     case OperationCode.Ceq:
       return this.ParseBinaryOperation(new Equality());
     case OperationCode.Cgt:
       return this.ParseBinaryOperation(new GreaterThan());
     case OperationCode.Cgt_Un:
       return this.ParseBinaryOperation(new GreaterThan() { IsUnsignedOrUnordered = true });
     case OperationCode.Clt:
       return this.ParseBinaryOperation(new LessThan());
     case OperationCode.Clt_Un:
       return this.ParseBinaryOperation(new LessThan() { IsUnsignedOrUnordered = true });
     case OperationCode.Div:
       return this.ParseBinaryOperation(new Division());
     case OperationCode.Div_Un:
       return this.ParseUnsignedBinaryOperation(new Division() { TreatOperandsAsUnsignedIntegers = true });
     case OperationCode.Mul:
     case OperationCode.Mul_Ovf:
     case OperationCode.Mul_Ovf_Un:
       return this.ParseMultiplication(currentOpcode);
     case OperationCode.Or:
       return this.ParseBinaryOperation(new BitwiseOr());
     case OperationCode.Rem:
       return this.ParseBinaryOperation(new Modulus());
     case OperationCode.Rem_Un:
       return this.ParseUnsignedBinaryOperation(new Modulus() { TreatOperandsAsUnsignedIntegers = true });
     case OperationCode.Shl:
       return this.ParseBinaryOperation(new LeftShift());
     case OperationCode.Shr:
       return this.ParseBinaryOperation(new RightShift());
     case OperationCode.Shr_Un:
       RightShift shrun = new RightShift();
       shrun.RightOperand = this.PopOperandStack();
       shrun.LeftOperand = this.PopOperandStackAsUnsigned();
       return shrun;
     case OperationCode.Sub:
     case OperationCode.Sub_Ovf:
     case OperationCode.Sub_Ovf_Un:
       return this.ParseSubtraction(currentOpcode);
     case OperationCode.Xor:
       return this.ParseBinaryOperation(new ExclusiveOr());
       }
 }
开发者ID:riverar,项目名称:devtools,代码行数:53,代码来源:SourceMethodBody.cs


示例16: ParseAddition

 private Expression ParseAddition(OperationCode currentOpcode)
 {
     Addition addition = new Addition();
       addition.CheckOverflow = currentOpcode != OperationCode.Add;
       if (currentOpcode == OperationCode.Add_Ovf_Un) {
     addition.TreatOperandsAsUnsignedIntegers = true; //force use of unsigned addition, even for cases where the operands are expressions that result in signed values
     return this.ParseUnsignedBinaryOperation(addition);
       } else
     return this.ParseBinaryOperation(addition);
 }
开发者ID:riverar,项目名称:devtools,代码行数:10,代码来源:SourceMethodBody.cs


示例17: ParseSubtraction

 private Expression ParseSubtraction(OperationCode currentOpcode)
 {
     Subtraction subtraction = new Subtraction();
       subtraction.CheckOverflow = currentOpcode != OperationCode.Sub;
       if (currentOpcode == OperationCode.Sub_Ovf_Un) {
     subtraction.TreatOperandsAsUnsignedIntegers = true;
     return this.ParseUnsignedBinaryOperation(subtraction);
       } else
     return this.ParseBinaryOperation(subtraction);
 }
开发者ID:riverar,项目名称:devtools,代码行数:10,代码来源:SourceMethodBody.cs


示例18: ParseMultiplication

 private Expression ParseMultiplication(OperationCode currentOpcode)
 {
     Multiplication multiplication = new Multiplication();
       multiplication.CheckOverflow = currentOpcode != OperationCode.Mul;
       if (currentOpcode == OperationCode.Mul_Ovf_Un) {
     multiplication.TreatOperandsAsUnsignedIntegers = true;
     return this.ParseUnsignedBinaryOperation(multiplication);
       } else
     return this.ParseBinaryOperation(multiplication);
 }
开发者ID:riverar,项目名称:devtools,代码行数:10,代码来源:SourceMethodBody.cs


示例19: SizeOfOperationCode

 private static uint SizeOfOperationCode(OperationCode opcode)
 {
     if (((int)opcode) > 0xff && (opcode < OperationCode.Array_Create)) return 2;
       return 1;
 }
开发者ID:harib,项目名称:Afterthought,代码行数:5,代码来源:ILGenerator.cs


示例20: WasteOperationCode

 public WasteOperationCode(OperationCode operationCode)
 {
     OperationCode = operationCode;
 }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:4,代码来源:WasteOperationCode.cs



注:本文中的OperationCode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OperationContext类代码示例发布时间:2022-05-24
下一篇:
C# OperationAnalysisContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap