本文整理汇总了C#中Job.IsFinishedState方法的典型用法代码示例。如果您正苦于以下问题:C# Job.IsFinishedState方法的具体用法?C# Job.IsFinishedState怎么用?C# Job.IsFinishedState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job.IsFinishedState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckJobCanBeRemoved
private bool CheckJobCanBeRemoved(Job job, string parameterName, string resourceString, params object[] list)
{
if (job.IsFinishedState(job.JobStateInfo.State))
{
return true;
}
Exception exception = new ArgumentException(PSRemotingErrorInvariants.FormatResourceString(resourceString, list), parameterName);
base.WriteError(new ErrorRecord(exception, "JobObjectNotFinishedCannotBeRemoved", ErrorCategory.InvalidOperation, job));
return false;
}
示例2: InitiateWorkflowStateDataTracking
public static void InitiateWorkflowStateDataTracking(Job parentJob)
{
if ((isWinSQMEnabled && !parentJob.IsFinishedState(parentJob.JobStateInfo.State)) && (parentJob.ChildJobs.Count != 0))
{
lock (syncObject)
{
if (!workflowStateData.ContainsKey(parentJob.InstanceId))
{
workflowStateData.Add(parentJob.InstanceId, new Tuple<int, int, int, int>((int) parentJob.ChildJobs.Count, 0, 0, 0));
foreach (Job job in parentJob.ChildJobs)
{
if (job.IsFinishedState(job.JobStateInfo.State))
{
IncrementWorkflowStateData(parentJob.InstanceId, job.JobStateInfo.State);
}
}
}
}
}
}
示例3: CheckIfMonitoredJobIsComplete
private void CheckIfMonitoredJobIsComplete(Job job, JobState jobState)
{
if (job.IsFinishedState(jobState))
{
lock (this._myLock)
{
this.StopMonitoringJob(job);
}
}
}