当前位置: 首页>>代码示例>>C#>>正文


C# Job.Start方法代码示例

本文整理汇总了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));
        }
开发者ID:YuukanOO,项目名称:FBlock,代码行数:16,代码来源:CoreTests.cs

示例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));
        }
开发者ID:YuukanOO,项目名称:FBlock,代码行数:11,代码来源:CoreTests.cs

示例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);
            }
         }
      }
开发者ID:sitecorian,项目名称:SitecoreSuperchargers.Historian,代码行数:42,代码来源:Handler.cs

示例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();
    }
开发者ID:syeager,项目名称:Knighthood,代码行数:18,代码来源:Player.cs

示例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();
 }
开发者ID:syeager,项目名称:Space-CUBEs,代码行数:12,代码来源:GoogleProfilePic.cs

示例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;
    }
开发者ID:korineczek,项目名称:OOSE,代码行数:17,代码来源:IRChandler.cs


注:本文中的Job.Start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。