本文整理汇总了C#中Job.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Job.Start方法的具体用法?C# Job.Start怎么用?C# Job.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job.Start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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));
}
示例3: Process
public void Process(object sender, EventArgs args)
{
Assert.ArgumentNotNull(sender, "sender");
Assert.ArgumentNotNull(args, "args");
Log.Info("Historian.Handler. Starting processing for databases ({0}).".FormatWith(_databases.Count), this);
foreach (string dbName in _databases)
{
if (dbName.IsNullOrEmpty())
{
Log.Error("Historian.Handler. Database parameter was invalid. Processing skipped", this);
continue;
}
if (!StringUtil.Join(Factory.GetDatabaseNames(), ",").Contains(dbName))
{
Log.Error("Historian.Handler. Database '{0} does not exist. Processing skipped".FormatWith(dbName), this);
continue;
}
var database = Factory.GetDatabase(dbName);
if (database == null)
{
Log.Error("Historian.Handler. Database '{0} does not exist. Processing skipped".FormatWith(dbName), this);
continue;
}
Log.Info("Historian.Handler. Starting processing for database '{0}'...".FormatWith(dbName), this);
try
{
var jobOptions = new JobOptions("Historian.Handler.ProcessDatabase", "", Context.Site.Name, this, "ProcessDatabase", new object[] { database });
var job = new Job(jobOptions);
job.Start();
}
catch (Exception exception)
{
Log.Error("Historian.Handler. Background job ProcessDatabase failed. ", exception);
}
}
}
示例4: JumpingEnter
private void JumpingEnter(Dictionary<string, object> info)
{
// attackAnimation
PlayAnimation(JumpingState);
currentStateJob = new Job(JumpingUpdate(), false);
currentStateJob.CreateChildJob(Climb(), climbTime);
currentStateJob.CreateChildJob(Float());
//
currentStateJob.JobCompleteEvent += (killed) =>
{
if (killed) return;
info = new Dictionary<string, object> {{"fromJump", true}};
SetState(FallingState, info);
};
currentStateJob.Start();
}
示例5: LoadProfilePic
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <param name="size"></param>
/// <param name="onComplete"></param>
/// <returns></returns>
public static Coroutine LoadProfilePic(string id, int size, Action<Texture2D> onComplete)
{
var job = new Job(LoadingProfilePic(id, size, onComplete), false);
return job.Start();
}
示例6: Start
void Start()
{
gameOver = false;
// Define and start second thread containing the IRC bot.
myJob = new Job();
myJob.Start();
// Set Democracy duration
democracyDuration = 10.0f;
// Start execution routine
StartCoroutine("Execute");
// Set turn count to 0
currentTurn = 0;
}