• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# JobStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中JobStatus的典型用法代码示例。如果您正苦于以下问题:C# JobStatus类的具体用法?C# JobStatus怎么用?C# JobStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JobStatus类属于命名空间,在下文中一共展示了JobStatus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateSelectCommand

        /// <summary>
        /// Creates a select command.
        /// </summary>
        /// <param name="connection">The connection to create the command with.</param>
        /// <param name="status">The job status to filter results on.</param>
        /// <param name="count">The maximum number of results to select.</param>
        /// <param name="before">The queued-after date to filter on.</param>
        /// <returns>A select command.</returns>
        protected override DbCommand CreateSelectCommand(DbConnection connection, JobStatus status, int count, DateTime before)
        {
            const string SqlStart = "SELECT{0} * FROM {1} WHERE {2} = {3} AND {4} < {5} ORDER BY {4};";

            DbCommand command = connection.CreateCommand();
            command.CommandType = CommandType.Text;
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Status"), status.ToString()));
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Before"), before));

            string countString = String.Empty;

            if (count > 0)
            {
                countString = String.Format(CultureInfo.InvariantCulture, " TOP ({0})", this.ParameterName("Count"));
                command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Count"), count));
            }

            command.CommandText = String.Format(
                CultureInfo.InvariantCulture,
                SqlStart,
                countString,
                this.TableName,
                this.ColumnName("Status"),
                this.ParameterName("Status"),
                this.ColumnName("QueueDate"),
                this.ParameterName("Before"));

            return command;
        }
开发者ID:ChadBurggraf,项目名称:blue-collar-old,代码行数:37,代码来源:SqlServerJobStore.cs


示例2: Abort

 public virtual void Abort()
 {
     if (!m_Thread.IsAlive)
         return;
     m_Thread.Abort();
     Status = JobStatus.NotStarted;
 }
开发者ID:MangoSister,项目名称:VR_Rehearsal,代码行数:7,代码来源:ThreadedJob.cs


示例3: PrepareNextActionOverride

 protected override GameAction PrepareNextActionOverride(out JobStatus progress)
 {
     if (this.m_group == null)
         return PrepareNextActionOverrideHerdless(out progress);
     else
         return PrepareNextActionOverrideHerd(out progress);
 }
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:7,代码来源:GrazeMoveAssignment.cs


示例4: EndTree

        Job EndTree(Job job, JobStatus endStatus)
        {
            // If this is the root, mutate to completed status.
            if (job.ParentId == null)
                return _jobMutator.Mutate<EndTransition>(job, status: JobStatus.Completed);

            job = _jobMutator.Mutate<EndTransition>(job, PendingEndStatus[endStatus]);

            /*
             * First, load the parent, find the await record for this job and
             * update its status to end status.
             */
            // ReSharper disable once PossibleInvalidOperationException
            var parent = _jobRepository.Load(job.ParentId.Value);
            var @await = parent.Continuation.Find(job);
            @await.Status = endStatus;

            /*
             * After we set the await's status, invoke ContinuationDispatcher to
             * ensure any pending await for parent is dispatched.
             * If ContinuationDispatcher returns any awaits, that means parent job is not
             * ready for completion.
             */
            var pendingAwaits = _continuationDispatcher.Dispatch(parent);

            if (!pendingAwaits.Any())
                EndTree(parent, JobStatus.Completed);

            return _jobMutator.Mutate<EndTransition>(job, endStatus);
        }
开发者ID:GeeksDiary,项目名称:Molecules,代码行数:30,代码来源:EndTransition.cs


示例5: Start

 public virtual void Start()
 {
     if (m_Thread.IsAlive)
         return;
     m_Thread.Start();
     Status = JobStatus.Started;
 }
开发者ID:MangoSister,项目名称:VR_Rehearsal,代码行数:7,代码来源:ThreadedJob.cs


示例6: PrepareNextActionOverrideHerd

        GameAction PrepareNextActionOverrideHerd(out JobStatus progress)
        {
            var center = m_group.GetCenter();

            var centerVector = center - this.Worker.Location;
            centerVector = new IntVector3(centerVector.X, centerVector.Y, 0);

            var r = this.Worker.World.Random;
            int moveStrength = m_group.GroupSize + 1;

            var l = centerVector.Length;

            if (l < moveStrength && r.Next(4) < 2)
            {
                progress = JobStatus.Ok;
                return new WaitAction(r.Next(4) + 1);
            }

            var moveVector = new IntVector3(r.Next(-moveStrength, moveStrength + 1), r.Next(-moveStrength, moveStrength + 1), 0);

            var v = centerVector + moveVector;

            var dir = v.ToDirection();

            if (dir == Direction.None)
            {
                progress = JobStatus.Ok;
                return new WaitAction(r.Next(4) + 1);
            }

            var action = DoMove(dir);

            progress = JobStatus.Ok;
            return action;
        }
开发者ID:tomba,项目名称:dwarrowdelf,代码行数:35,代码来源:GrazeMoveAssignment.cs


示例7: LoadBy

 public IEnumerable<Job> LoadBy(JobStatus status)
 {
     using (var persistenceStore = _persistenceProvider.CreateStore())
     {
         return persistenceStore.LoadBy(status);
     }
 }
开发者ID:GeeksDiary,项目名称:Molecules,代码行数:7,代码来源:DelegatingPersistenceStore.cs


示例8: Change

        public Job Change(Job job, JobStatus newStatus, Activity activity = null)
        {
            switch (newStatus)
            {
                case JobStatus.Ready:
                    return CheckStatusAndInvoke(job, new[] {JobStatus.Created},
                        () => _jobMutator.Mutate<StatusChanger>(job, status: newStatus));
                case JobStatus.Running:
                    return CheckStatusAndInvoke(job, RunnableStatuses, () => _runningTransition.Transit(job));
                case JobStatus.Completed:
                    return CheckStatusAndInvoke(job, CompletableStatus,
                        () => _endTransition.Transit(job, JobStatus.Completed));
                case JobStatus.Failed:
                    return CheckStatusAndInvoke(job, FallibleStatuses, () => _failedTransition.Transit(job));
                case JobStatus.WaitingForChildren:
                    return CheckStatusAndInvoke(job, AwaitableStatus,
                        () => _waitingForChildrenTransition.Transit(job, activity));
                case JobStatus.Poisoned:
                    return CheckStatusAndInvoke(job, PoisonableStatus,
                        () => _endTransition.Transit(job, JobStatus.Poisoned));
                case JobStatus.Cancelling:
                    return _jobMutator.Mutate<StatusChanger>(job, status: newStatus);
                case JobStatus.Cancelled:
                    return _endTransition.Transit(job, JobStatus.Cancelled);
            }

            return job;
        }
开发者ID:inprotech-dev,项目名称:dependable,代码行数:28,代码来源:StatusChanger.cs


示例9: OnStateChanged

        protected override void OnStateChanged(JobStatus status)
        {
            if (status == JobStatus.Ok)
                return;

            // else Abort, Done or Fail
        }
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:7,代码来源:GrazeMoveAssignment.cs


示例10: Run

	public void Run ()
	{
		Status = JobStatus.Running;
		if (Execute ())
			Status = JobStatus.Finished;
		else
			Status = JobStatus.Failed;
	}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:8,代码来源:JobStore.cs


示例11: JobCompletedEventArgs

 /// <summary>
 /// Initializes a new instance of the <see cref="JobCompletedEventArgs"/> class.
 /// </summary>
 /// <param name="jobName">Name of the job.</param>
 /// <param name="action">The action.</param>
 /// <param name="jobId">The job id.</param>
 /// <param name="started">The time the job run started.</param>
 /// <param name="finished">The time the job run ended.</param>
 /// <param name="result">The result of the job run.</param>
 /// <param name="status">The status of the job run.</param>
 public JobCompletedEventArgs(string jobName, JobAction action, string jobId, DateTime started, DateTime finished, string result, JobStatus status)
     : base(jobName, action, jobId)
 {
     Started = started;
     Finished = finished;
     Result = result;
     Status = status;
 }
开发者ID:WSmartJ18,项目名称:Exceptionless,代码行数:18,代码来源:JobCompletedEventArgs.cs


示例12: PublishJobEntry

 public PublishJobEntry(Handle jobHandle, string jobName, string category, JobStatus jobStatus, User jobOwner)
 {
     JobHandle = jobHandle.ToString();
      Name = jobName;
      Status = jobStatus;
      Owner = jobOwner;
      Category = category;
 }
开发者ID:ivansharamok,项目名称:AdvancedPublishDialog,代码行数:8,代码来源:PublishJobEntry.cs


示例13: HpcJobSubmission

        internal HpcJobSubmission(HpcLinqContext context)
        {
            this.m_context = context;
            this.m_status = JobStatus.NotSubmitted;

            //@@TODO[P0] pass the runtime to the DryadJobSubmission so that it can use the scheduler instance.
            //@@TODO: Merge DryadJobSubmission into Ms.Hpc.Linq. Until then make sure Context is not disposed before DryadJobSubmission.
            this.m_job = new DryadJobSubmission(m_context.GetIScheduler());
        }
开发者ID:KarthikTunga,项目名称:Dryad,代码行数:9,代码来源:HpcJobSubmission.cs


示例14: PrepareNextActionOverride

        protected override GameAction PrepareNextActionOverride(out JobStatus progress)
        {
            var dir = m_fleeVector.ToDirection();

            var action = DoMove(dir);

            progress = JobStatus.Ok;
            return action;
        }
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:9,代码来源:FleeMoveAssignment.cs


示例15: JobContext

 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.MarshalByRefObject" /> class. 
 /// </summary>
 public JobContext(string name, string description, DateTime lastRunTime, JobStatus lastStatus, IDictionary<string, object> arguments, Action<string> updateStatus, IDependencyResolver resolver)
 {
     UpdateStatusAction = updateStatus;
     Name = name;
     Description = description;
     LastRunTime = lastRunTime;
     LastStatus = lastStatus;
     Arguments = arguments;
 }
开发者ID:khoussem,项目名称:Exceptionless,代码行数:12,代码来源:JobContext.cs


示例16: JobContext

 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.MarshalByRefObject" /> class. 
 /// </summary>
 public JobContext(string name, string description, DateTime lastRunTime, JobStatus lastStatus, IDictionary<string, object> arguments, Action<string> updateStatus)
 {
     _updateStatus = updateStatus;
     _name = name;
     _description = description;
     _lastRunTime = lastRunTime;
     _lastStatus = lastStatus;
     _arguments = arguments;
 }
开发者ID:modulexcite,项目名称:LoreSoft.Shared,代码行数:12,代码来源:JobContext.cs


示例17: Transit

        public Job Transit(Job job, JobStatus endStatus)
        {
            if (job == null) throw new ArgumentNullException("job");

            if (!EndStatuses.Contains(endStatus))
                throw new ArgumentOutOfRangeException("endStatus", endStatus, "Not a valid end status.");

            return job.ParentId == null ?
                _jobMutator.Mutate<EndTransition>(job, status: endStatus) : EndTree(job, endStatus);
        }
开发者ID:GeeksDiary,项目名称:Molecules,代码行数:10,代码来源:EndTransition.cs


示例18: main_Load

        private void main_Load(object sender, EventArgs e)
        {
            JobStatus JS = new JobStatus(DataList.EpicConn);

            bool morePages;

            JobStatusDataSet JSDS = JS.GetRows("Plant = 'MfgSys' AND Jobclosed = False AND JobComplete = false AND JobFirm=false AND JobEngineered=true AND JobReleased=false BY DueDate", "", 100, 0, out morePages);

            dataGridView1.DataSource = JSDS.Tables[0];
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:10,代码来源:main.cs


示例19: Job

        public Job(JobStatus status, String title, String description, DateTime deadline)
        {
            Random r = new Random((Int32)DateTime.Now.Ticks);
            key = r.Next();

            Status = status;
            Title = title;
            Description = description;
            DeadlineDate = deadline;
        }
开发者ID:jeka-js,项目名称:MyJobs,代码行数:10,代码来源:Job.cs


示例20: ParentShouldGoToIntermediaryStatusBeforeEndStatus

            public void ParentShouldGoToIntermediaryStatusBeforeEndStatus(JobStatus status)
            {
                Job root = _world.NewJob.In(JobStatus.WaitingForChildren);
                Job parent = _world.NewJob.In(JobStatus.WaitingForChildren).AsChildOf(ref root, JobStatus.Ready);
                var child = _world.NewJob.In(JobStatus.Running).AsChildOf(ref parent, JobStatus.Ready);

                _world.NewEndTransition().Transit(child, status);

                _world.JobMutator.Mutations(parent).Verify(JobStatus.ReadyToComplete, JobStatus.Completed);
            }
开发者ID:GeeksDiary,项目名称:Molecules,代码行数:10,代码来源:EndTransitionFacts.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Jogador类代码示例发布时间:2022-05-24
下一篇:
C# JobKey类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap