本文整理汇总了C#中Job.Process方法的典型用法代码示例。如果您正苦于以下问题:C# Job.Process方法的具体用法?C# Job.Process怎么用?C# Job.Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job.Process方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateButton_Click
private void GenerateButton_Click(object sender, EventArgs e)
{
string filename;
InitialiseSaveDialog();
if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
filename = saveFileDialog.FileName;
string dstLang = destinationLanguage.SelectedItem.ToString();
string queryType = queryTypeComboBox.SelectedItem.ToString();
Job job = new Job(
connectionStringTextBox.Text,
dstTableTextBox.Text,
filename,
sqlTextBox.Text,
() => QueryWriterFactory.Instance.Get(dstLang),
() => QueryFactory.Instance.Get(queryType),
(j,c) => HandleKeysRequired(j,c),
(j, ex) => HandleException(j, ex),
(j) => HandleComplete(j));
StartScriptGeneration();
job.Process();
}
else
{
statusLabel.Text = "Cancelled.";
}
}
示例2: TestContext
public void TestContext()
{
Job<string, int> job = new Job<string, int>();
job
.Start(new DummyComponent1())
.End(new DummyComponent2());
Assert.AreEqual(0, job.Process(string.Empty));
job
.Start(new DummyComponent1(5))
.End(new DummyComponent2());
Assert.AreEqual(5, job.Process(string.Empty));
}
示例3: TestJob
public void TestJob()
{
Job<string, string> job = new Job<string, string>("My job");
job.StartAndEnd(new DummyComponent1());
Assert.AreEqual("My job", job.Name);
Assert.AreEqual("My job", job.Process(string.Empty));
}
示例4: TestChaining
public void TestChaining()
{
Job<string, string> job = new Job<string, string>();
job
.Start(new DummyComponent1(1337))
.Then(new DummyComponent2())
.End(new DummyComponent3());
Assert.AreEqual("1337", job.Process(string.Empty));
}
示例5: TestJobNoStart
public void TestJobNoStart()
{
Job<string, string> job = new Job<string, string>();
job.Process(string.Empty);
}