当前位置: 首页>>代码示例>>C#>>正文


C# RequestMessage类代码示例

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


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

示例1: HandleRequest

 protected override void HandleRequest(RequestMessage request, PeerState peer)
 {
     if (!peer.IsChoked && request.Length <= Global.Instance.BlockSize)
     {
         BlockManager.GetBlock(new byte[request.Length], request.Index, request.Offset, request.Length, BlockRead, peer);
     }
 }
开发者ID:NewFuture,项目名称:BitTorrent,代码行数:7,代码来源:SeedMode.cs

示例2: call_NSPRFSH01

        public void call_NSPRFSH01()
        {
            string errortxt = this.Vaildate();
            if (errortxt != string.Empty)
            {
                MessageBox.Show(errortxt);
                this.focusControl.Focus();
                return;
            }
            string[] tmp = this.toid.Text.Split(new char[] { ' ' });
            string toidstr = tmp[0];

            sh01_req.Utility sh01req = sh01_req.Utility.CreateSH(toidstr);
            sh01req.UtilityHeader.userid = this.LoginUser.UserName;
            RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor,
                  enumMessageType.Utility,
                  enumRequestMethod.functionOperation, this.LoginUser,
                  enumSendSysId.EXceed,
                  sh01req);
            ResponseMessage response = ThreadHelper.Execute(requestmessage);
            string errormsg = response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(response.GetErrorMessage());

            }
            else
            {

                MessageBox.Show("发运完成");
            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:32,代码来源:NSPRFSH01Frm_2.cs

示例3: loadReason

        private void loadReason()
        {
            RFDeviceAPP.Common.TaskReason.Request.TaskReason request = RFDeviceAPP.Common.TaskReason.Request.TaskReason.Craete(this.LoginUser.UserName);
            RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor,
                  enumMessageType.TaskReason,
                  enumRequestMethod.list, this.LoginUser,
                  enumSendSysId.EXceed,
                  request);
            RequestWorkItem workitem = new RequestWorkItem(requestmessage, 1);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(requestmessage);
            string errormsg = Response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(errormsg);

            }
            else
            {
                RFDeviceAPP.Common.TaskReason.Response.TaskReason tasklist = Response.Deserialize<RFDeviceAPP.Common.TaskReason.Response.TaskReason>();
                foreach (RFDeviceAPP.Common.TaskReason.Response.TaskReasonHeader header in tasklist.TaskReasonHeaders)
                {
                    string line = header.TASKMANAGERREASONKEY;
                    this.listBox1.Items.Add(line);
                }
                this.listBox1.SelectedIndex = 0;

            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:29,代码来源:Frmreason.cs

示例4: submitMove

        public void submitMove(string sku, string fromloc, string fromid, string toid, string qty, string actloc)
        {
            string errortxt = this.Vaildate();
            if (errortxt != string.Empty)
            {
                MessageBox.Show(errortxt);
                this.focusControl.Focus();
                return;
            }
            reqitem = req.Utility.Create( sku,  fromloc,  fromid,  toid,  qty,  actloc);
            reqitem.UtilityHeader.userid = this.loginuser.UserName;
             RequestMessage request = new RequestMessage(enumRequestType.MessageProcessor,
                  enumMessageType.Utility,
                  enumRequestMethod.functionOperation, this.loginuser,
                  enumSendSysId.EXceed,
                  reqitem);
            //RequestWorkItem workitem = new RequestWorkItem(request, 1);
            ResponseMessage response = ThreadHelper.Execute(request);
            string errormsg = response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(response.GetErrorMessage());
            }
            else
            {
                MessageBox.Show("移动完成");
                Clean();

            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:30,代码来源:NSPRFRL01B1FLFrm.cs

示例5: ExchangeAsClient

        public ResponseMessage ExchangeAsClient(RequestMessage request)
        {
            PrepareExchangeAsClient();

            stream.Send(request);
            return stream.Receive<ResponseMessage>();
        }
开发者ID:BradBarnich,项目名称:Halibut,代码行数:7,代码来源:MessageExchangeProtocol.cs

示例6: call_NSPRFIQ01

        private void call_NSPRFIQ01()
        {
            this.request.UtilityHeader.userid = this.LoginUser.UserName;
            RequestMessage query = new RequestMessage(enumRequestType.MessageProcessor,
                enumMessageType.Utility,
                enumRequestMethod.functionOperation, this.LoginUser,
                enumSendSysId.EXceed,
                this.request);

            ResponseMessage response = ThreadHelper.Execute(query);
            string errormsg = response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(response.GetErrorMessage());
            }
            else
            {
                RFDeviceAPP.Common.NSPRFIQ01.Response.Utility result = response.Deserialize<RFDeviceAPP.Common.NSPRFIQ01.Response.Utility>();
                //Console.Write(result);
                //FrmStockResult resultfrm = new FrmStockResult(result);
                FrmStockResultDetail resultfrm = new FrmStockResultDetail(result);
                resultfrm.ShowDialog();
                this.Activate();
                this.storerkey.SetFocus();
            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:26,代码来源:FrmStockQuery.cs

示例7: SecureClientClearsPoolWhenAllConnectionsCorrupt

        public void SecureClientClearsPoolWhenAllConnectionsCorrupt()
        {
            var pool = new ConnectionPool<ServiceEndPoint, IConnection>();
            var stream = Substitute.For<IMessageExchangeStream>();
            stream.When(x => x.IdentifyAsClient()).Do(x => { throw new ConnectionInitializationFailedException(""); });
            for (int i = 0; i < SecureClient.RetryCountLimit; i++)
            {
                var connection = Substitute.For<IConnection>();
                connection.Protocol.Returns(new MessageExchangeProtocol(stream));
                pool.Return(endpoint, connection);
            }

            var request = new RequestMessage
            {
                Destination = endpoint,
                ServiceName = "IEchoService",
                MethodName = "SayHello",
                Params = new object[] { "Fred" }
            };

            var secureClient = new SecureClient(endpoint, Certificates.Octopus, log, pool);
            ResponseMessage response = null;
            secureClient.ExecuteTransaction((mep) => response = mep.ExchangeAsClient(request));

            // The pool should be cleared after the second failure
            stream.Received(2).IdentifyAsClient();
            // And a new valid connection should then be made
            Assert.AreEqual("Fred...", response.Result);
        }
开发者ID:BradBarnich,项目名称:Halibut,代码行数:29,代码来源:SecureClientFixture.cs

示例8: call_UserData

        private void call_UserData(string username, string password)
        {
            userinforeq = fllg_req.Utility.Create(username, password);
            RequestMessage searchrequest = new RequestMessage(enumRequestType.MessageProcessor,
                enumMessageType.Utility,
                enumRequestMethod.functionOperation, this._user,
                enumSendSysId.EXceed,
                userinforeq);
            RequestWorkItem workitem = new RequestWorkItem(searchrequest, 1);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(searchrequest);
            if (Response.GetErrorMessage() != string.Empty)
            {
                MessageBox.Show(Response.GetErrorMessage());
                this.usernametxt.Focus();
            }
            else
            {
                this.userinfores = Response.Deserialize<fllg_res.Utility>();
                if (this._user.UserName == string.Empty)
                {
                    MessageBox.Show("用户名不存在");
                    this.usernametxt.Focus();
                }
                else
                {
                    this.screen = this.userinfores.UtilityHeader[0].Screen.Split(new char[] { ';' });
                    //InvokeHelper.Set(this, "DialogResult", DialogResult.OK);
                    DialogResult = DialogResult.OK;

                }
            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:33,代码来源:Login.cs

示例9: OnNewUpdate

 private void OnNewUpdate(
     IRequestManager<ConfigurationUpdate, ConfigurationUpdateAnswer> sender, 
     RequestMessage<ConfigurationUpdate> request)
 {
     var newConfiguration = request.request.update;
     //Not the most efficient code, but premature optimisation is root of evil.
     lock (internalLock)
     {
         var existing = allConfigurations.FirstOrDefault(o =>
             o.Instance == newConfiguration.Instance &&
             o.Key == newConfiguration.Key
         );
         if (existing != null)
         {
             existing.Value = newConfiguration.Value;
         }
         else
         {
             allConfigurations.Add(newConfiguration);
         }
     }
     this.persister.Persist(allConfigurations);
     //Todo here broadcast the update?
     sender.Send(new AnwserMessage<ConfigurationUpdateAnswer>()
     {
         id = request.id,
         answer = new ConfigurationUpdateAnswer()
         {
             result = true
         }
     });
 }
开发者ID:Paraintom,项目名称:ConfigurationService,代码行数:32,代码来源:ConfigurationRequestHandler.cs

示例10: call_asnlist01

        public void call_asnlist01(string pier)
        {
            //this.Start();
            //this.portlist.Items.Clear();
            //this.portlist.Enabled = false;
            asnlist01req = asnlist01_req.AdvancedShipNotice.Create(pier);

            RequestMessage request = new RequestMessage(enumRequestType.MessageProcessor,
                  enumMessageType.AdvancedShipNotice,
                  enumRequestMethod.listHead, this.loginuser,
                  enumSendSysId.EXceed,
                  asnlist01req);
            //RequestWorkItem workitem = new RequestWorkItem(request, 2);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(request);
            string errormsg = Response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(Response.GetErrorMessage());
            }
            else
            {
                asnlist01res = Response.Deserialize<asnlist01_res.AdvancedShipNotice>();
                foreach (asnlist01_res.AdvancedShipNoticeHeader body in asnlist01res.AdvancedShipNoticeHeaders)
                {
                    if (!string.IsNullOrEmpty(body.ReceiptKey))
                    {
                        this.addasnlist(body.ReceiptKey + " " + body.StorerKey + " " + body.Status);
                    }
                    //InvokeHelper.Invoke(this, "addasnlist", body.ReceiptKey + " " + body.StorerKey + " " + body.Status);
                }
            }
        }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:33,代码来源:LeaveFrm.cs

示例11: RawRequestMessage

 public RawRequestMessage(RequestMessage rm, int commandCount)
 {
     var prefix = (rm.Prefix ?? "");
     Id = prefix + (prefix.Length>0?"_":"") + commandCount;
     Type = rm.Type??"request";
     Uri = rm.Uri;
     Payload = rm.Payload;
 }
开发者ID:gr4b4z,项目名称:lgtv.net,代码行数:8,代码来源:RawRequestMessage.cs

示例12: GetRequestMessage

 private static RequestMessage<ConfigurationSubscription> GetRequestMessage(int requestId, string goodInstance)
 {
     var request = new RequestMessage<ConfigurationSubscription>()
     {
         id = requestId,
         request = new ConfigurationSubscription() {instance = goodInstance}
     };
     return request;
 }
开发者ID:Paraintom,项目名称:ConfigurationService,代码行数:9,代码来源:ConfigurationRequestHandlerTests.cs

示例13: Execute

		public override ResponseMessage Execute (RequestMessage req)
		{
			// Start the shutdown process in a separate thread
			// to avoid a deadlock: BeginShutdown() waits until
			// all worker process are finished, but this method
			// itself is part of a worker.
			ExceptionHandlingThread.Start (new ThreadStart (DoShutdown));

			return new EmptyResponse ();
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:10,代码来源:RemoteControlExecutors.cs

示例14: InvokeAndWrapAnyExceptions

 static ResponseMessage InvokeAndWrapAnyExceptions(RequestMessage request, Func<RequestMessage, ResponseMessage> incomingRequestProcessor)
 {
     try
     {
         return incomingRequestProcessor(request);
     }
     catch (Exception ex)
     {
         return ResponseMessage.FromException(request, ex);
     }
 }
开发者ID:BradBarnich,项目名称:Halibut,代码行数:11,代码来源:MessageExchangeProtocol.cs

示例15: Publish

 public override void Publish(RequestMessage request)
 {
     try
     {
         Write(request);
     }
     catch (Exception e)
     {
         OnChannelError(e);
     }
 }
开发者ID:onesimoh,项目名称:Andamio,代码行数:11,代码来源:FileSystemChannel.cs


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