本文整理匯總了C#中System.ServiceModel.ChannelFactory.CreateSuspended方法的典型用法代碼示例。如果您正苦於以下問題:C# ChannelFactory.CreateSuspended方法的具體用法?C# ChannelFactory.CreateSuspended怎麽用?C# ChannelFactory.CreateSuspended使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.ServiceModel.ChannelFactory
的用法示例。
在下文中一共展示了ChannelFactory.CreateSuspended方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static void Main()
{
// Same workflow as Dataflow sample
Activity workflow = LoadProgram("Dataflow.xaml");
WorkflowServiceHost host = new WorkflowServiceHost(workflow,
new Uri("http://localhost/Dataflow.xaml"));
WorkflowControlEndpoint controlEndpoint = new WorkflowControlEndpoint(
new BasicHttpBinding(),
new EndpointAddress(new Uri("http://localhost/DataflowControl.xaml")));
CreationEndpoint creationEndpoint = new CreationEndpoint(
new BasicHttpBinding(),
new EndpointAddress(new Uri("http://localhost/DataflowControl.xaml/Creation")));
host.AddServiceEndpoint(controlEndpoint);
host.AddServiceEndpoint(creationEndpoint);
host.Open();
Console.WriteLine("Host open...");
IWorkflowCreation creationClient = new ChannelFactory<IWorkflowCreation>(creationEndpoint.Binding, creationEndpoint.Address).CreateChannel();
// Start a new instance of the workflow
Guid instanceId = creationClient.CreateSuspended(null);
WorkflowControlClient controlClient = new WorkflowControlClient(controlEndpoint);
controlClient.Unsuspend(instanceId);
Console.WriteLine("Hit any key to exit Host...");
Console.ReadLine();
}