本文整理汇总了C#中WorkflowRuntime.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# WorkflowRuntime.Dispose方法的具体用法?C# WorkflowRuntime.Dispose怎么用?C# WorkflowRuntime.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkflowRuntime
的用法示例。
在下文中一共展示了WorkflowRuntime.Dispose方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WorkFlowTest
public void WorkFlowTest ()
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (SequentialWorkflow);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
workflowRuntime.Dispose ();
Assert.AreEqual (true, code_execute, "C1#1");
}
示例2: TestActivity
public void TestActivity ()
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
DocumentService DocumentService = new DocumentService ();
Type type = typeof (WorkFlowCallExternal);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
ExternalDataExchangeService dataExchangeService = new ExternalDataExchangeService ();
workflowRuntime.AddService (dataExchangeService);
dataExchangeService.AddService (DocumentService);
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
workflowRuntime.Dispose ();
Assert.AreEqual ("Joan Martinez", text, "C1#1");
Assert.AreEqual ("First", document, "C1#2");
}
示例3: CheckRule
private void CheckRule (CodeBinaryOperatorExpression expression, bool executed, string error)
{
WorkflowInstance wi;
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (WorkFlowIfElseRule);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
executed1 = false;
executed2 = false;
check_condition = expression;
wi = workflowRuntime.CreateWorkflow (type);
wi.Start ();
waitHandle.WaitOne ();
if (executed) {
Assert.AreEqual (true, executed1, error);
Assert.AreEqual (false, executed2, error);
} else {
Assert.AreEqual (false, executed1, error);
Assert.AreEqual (true, executed2, error);
}
workflowRuntime.Dispose ();
}
示例4: Main
static void Main ()
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (WorkFlowIfElse);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
workflowRuntime.Dispose ();
}
示例5: WorkFlowTest
public void WorkFlowTest ()
{
events = new List <string> ();
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (SequentialWorkflowParallel);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
workflowRuntime.Dispose ();
Assert.AreEqual ("IfElseCondition", events[0], "C1#1");
Assert.AreEqual ("PrepareMail1_ExecuteCode", events[1], "C1#2");
Assert.AreEqual ("PrepareMail2_ExecuteCode", events[2], "C1#3");
Assert.AreEqual ("PrepareMail3_ExecuteCode", events[3], "C1#4");
Assert.AreEqual ("CodeCloseMailProgram2_ExecuteCode", events[4], "C1#8");
Assert.AreEqual ("CodeCloseMailProgram3_ExecuteCode", events[5], "C1#9");
Assert.AreEqual ("CodeCloseMailProgram1_ExecuteCode", events[6], "C1#10");
}
示例6: Initialize
//.........这里部分代码省略.........
}
if (!string.IsNullOrEmpty(config["synchronousExecution"]))
{
this._synchronousExecution = Convert.ToBoolean(config["synchronousExecution"]);
config.Remove("synchronousExecution");
}
if (!string.IsNullOrEmpty(config["defaultStartTime"]))
{
this._defaultEndTime = config["defaultStartTime"];
config.Remove("defaultStartTime");
}
if (!string.IsNullOrEmpty(config["defaultEndTime"]))
{
this._defaultEndTime = config["defaultEndTime"];
config.Remove("defaultEndTime");
}
if (!string.IsNullOrEmpty(config["timeToExpire"]))
{
this._timeToExpire = TimeSpan.Parse(config["timeToExpire"]);
config.Remove("timeToExpire");
}
if (!string.IsNullOrEmpty(config["includeWeekends"]))
{
this._includeWeekends = Convert.ToBoolean(config["includeWeekends"]);
config.Remove("includeWeekends");
}
if (!string.IsNullOrEmpty(config["requestSchemaPath"]))
{
this._requestSchemaPath = config["requestSchemaPath"];
config.Remove("requestSchemaPath");
}
if (!string.IsNullOrEmpty(config["responseSchemaPath"]))
{
this._responseSchemaPath = config["responseSchemaPath"];
config.Remove("responseSchemaPath");
}
if (config.Count > 0)
throw new ProviderException(string.Format("Unknown config attribute '{0}'", config.GetKey(0)));
#region Workflow Runtime Initialization
if (theWorkflowRuntime == null)
{
lock (this)
{
if (theWorkflowRuntime == null)
{
theWorkflowRuntime = new WorkflowRuntime();
theWorkflowRuntime.WorkflowLoaded += new EventHandler<WorkflowEventArgs>(theWorkflowRuntime_WorkflowLoaded);
theWorkflowRuntime.WorkflowIdled += new EventHandler<WorkflowEventArgs>(theWorkflowRuntime_WorkflowIdled);
theWorkflowRuntime.WorkflowCompleted += new EventHandler<WorkflowCompletedEventArgs>(theWorkflowRuntime_WorkflowCompleted);
theWorkflowRuntime.WorkflowTerminated += new EventHandler<WorkflowTerminatedEventArgs>(theWorkflowRuntime_WorkflowTerminated);
theWorkflowRuntime.WorkflowSuspended += new EventHandler<WorkflowSuspendedEventArgs>(theWorkflowRuntime_WorkflowSuspended);
// Used for synchronous execution of workflow instances.
if (this.SynchronousExecution)
theSchedulerService = theWorkflowRuntime.GetService<ManualWorkflowSchedulerService>();
// Add the external data service
ExternalDataExchangeService dataService = new ExternalDataExchangeService();
theWorkflowRuntime.AddService(dataService);
// Add custom wiki management service.
theServiceProvider = new ServiceProviderHelper();
dataService.AddService(theServiceProvider);
// Add system SQL state service.
SqlWorkflowPersistenceService stateService = new SqlWorkflowPersistenceService(
ConfigurationManager.ConnectionStrings[this.ConnectionStringName].ConnectionString);
theWorkflowRuntime.AddService(stateService);
try
{
Trace.TraceInformation("Starting workflow engine.");
// Start
theWorkflowRuntime.StartRuntime();
Trace.TraceInformation("Workflow engine was sucessfully started.");
}
catch (Exception ex)
{
Trace.TraceError(string.Format(
"Error while starting the workflow engine. Description: {0}", ex.Message));
theWorkflowRuntime.Dispose();
throw;
}
}
}
}
#endregion
}
示例7: WorkFlowTest
public void WorkFlowTest ()
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (SimpleWorkFlowDelay);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
workflowRuntime.Dispose ();
Assert.AreEqual (3, files_counted, "C1#1");
Assert.AreEqual (3, backup_executed, "C1#2");
}
示例8: IfElseConditionDoubleFalse
public void IfElseConditionDoubleFalse ()
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime ();
Type type = typeof (WorkFlowIfElseDoubleCondition);
workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
ifelse_condition1 = true;
ifelse_condition2 = false;
executed1 = false;
executed2 = false;
workflowRuntime.CreateWorkflow (type).Start ();
waitHandle.WaitOne ();
Assert.AreEqual (true, executed1, "C1#1");
Assert.AreEqual (false, executed2, "C1#2");
workflowRuntime.Dispose ();
}