最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Using the Remoting Callbacks in .Net Applications
时间:2022-07-02 12:03:15 编辑:袖梨 来源:一聚教程网
Invoking the Remote Method
This code snippet shows invoking a method on the Remoting objects using the asynchronous design pattern. Clicking on the button Run/Abort the following code snippet is going to be perform:
private void buttonRM_Click(object sender, System.EventArgs e)
{
try
{
if(buttonRM.Text == "Run")
{
// client state
buttonRM.Text = "Busy";
progressBarStatus.Value = 0;
textBoxStatus.Text = string.Empty;
cb.State = true;
//
// arguments
int timeinsec = 10;
string ticketId = "ProgressBar";
RemoteCallback wire = new RemoteCallback(cb.Progress);
//
// invoking method on the objectA
AsyncCallback acbA = new AsyncCallback(asyncCallBackA);
DelegateGiveMeCallback dA = new DelegateGiveMeCallback(roA.GiveMeCallback);
IAsyncResult arA = dA.BeginInvoke(timeinsec, ticketId, wire, acbA, null);
//
// invoking method on the objectX
AsyncCallback acbX = new AsyncCallback(asyncCallBackX);
This code snippet shows invoking a method on the Remoting objects using the asynchronous design pattern. Clicking on the button Run/Abort the following code snippet is going to be perform:
private void buttonRM_Click(object sender, System.EventArgs e)
{
try
{
if(buttonRM.Text == "Run")
{
// client state
buttonRM.Text = "Busy";
progressBarStatus.Value = 0;
textBoxStatus.Text = string.Empty;
cb.State = true;
//
// arguments
int timeinsec = 10;
string ticketId = "ProgressBar";
RemoteCallback wire = new RemoteCallback(cb.Progress);
//
// invoking method on the objectA
AsyncCallback acbA = new AsyncCallback(asyncCallBackA);
DelegateGiveMeCallback dA = new DelegateGiveMeCallback(roA.GiveMeCallback);
IAsyncResult arA = dA.BeginInvoke(timeinsec, ticketId, wire, acbA, null);
//
// invoking method on the objectX
AsyncCallback acbX = new AsyncCallback(asyncCallBackX);
相关文章
- 《原神》5.2卡池抽取建议 11-14
- 《原神》5.2版本新怪物介绍 11-14
- 《原神》希诺宁增伤触发方法 11-14
- 《原神》循音觅奇活动入口 11-14
- 《原神》循音觅奇兑换码获取方法 11-14
- 《原神》花羽会活动飞行技巧介绍 11-14