本文整理汇总了C#中TaskState类的典型用法代码示例。如果您正苦于以下问题:C# TaskState类的具体用法?C# TaskState怎么用?C# TaskState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskState类属于命名空间,在下文中一共展示了TaskState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IOPH_EZLinkDongle
public IOPH_EZLinkDongle(ADTRecord adtRec, IAppMainWindow mainWin)
{
this._adtRec = adtRec;
this._mainWin = mainWin;
this._teleFromWin = new Telegram(0x3e8);
this._teleToWin = new Telegram(0x3e8);
this._replyData = new DataBuffer(0x3e8);
this._isSeries = false;
this._seriesExecStat = SeriesExecutionState.Stop;
this._taskEvent = new AutoResetEvent(false);
this._taskState = TaskState.TaskReady_OK;
if (adtRec.isUsbEZLinkDevice())
{
this._ddi = DDI_EZLinkDongle.instance();
}
else if (adtRec.isTESTDevice())
{
this._ddi = DDI_TEST.instance();
}
else
{
GlobalServices.ErrMsg("FATAL ERROR: IOPH_EZLinkDongle", "I/O port type not supported, exit WDS!");
Application.Exit();
}
this._iot = new Thread(new ThreadStart(this.doDeviceIO));
this._iot.IsBackground = true;
this._iot.Name = "IOPH_EZLink thread";
this._isTelegramRequest = false;
this._isRxTimerRequest = false;
this._isReadRxPacketEnabled = false;
this._iot.Start();
}
示例2: TaskSnapshot
/// <summary>
/// Create a new progress snapshot.
/// </summary>
/// <param name="state">The current State of the task.</param>
/// <param name="unitsByte"><c>true</c> if <see cref="UnitsProcessed"/> and <see cref="UnitsTotal"/> are measured in bytes; <c>false</c> if they are measured in generic units.</param>
/// <param name="unitsProcessed">The number of units that have been processed so far.</param>
/// <param name="unitsTotal">The total number of units that are to be processed; -1 for unknown.</param>
public TaskSnapshot(TaskState state, bool unitsByte = false, long unitsProcessed = 0, long unitsTotal = -1)
{
State = state;
UnitsByte = unitsByte;
UnitsProcessed = unitsProcessed;
UnitsTotal = unitsTotal;
}
示例3: RequestTaskState
public override void RequestTaskState(TaskState taskState)
{
if (taskState == TaskState.Stopped || taskState == TaskState.Finished || taskState == TaskState.Paused)
{
while (true)
{
try
{
tcpListener.Stop();
tcpListener.Server.Close();
}
catch
{
}
if (base.RequestTaskState(taskState, TimeSpan.FromSeconds(0.5)))
{
return;
}
if (taskState == TaskState.Stopped || taskState == TaskState.Finished)
{
return;
}
}
}
base.RequestTaskState(taskState);
}
示例4: FlowState
internal FlowState(Flow flow)
{
this.Tasks = new List<TaskState>();
this.Art = flow.Art;
foreach (var task in flow.Nodes)
{
TaskState state = new TaskState()
{
ItemsProcessed = task.ItemsProcessed,
Name = task.Name,
Status = task.Status,
TotalSecondsBlocked = task.TotalSecondsBlocked,
TotalSecondsProcessing = task.TotalSecondsProcessing,
Position = task.Position
};
this.Tasks.Add(state);
}
this.Streams = new List<StreamState>();
foreach (var stream in flow.Streams)
{
StreamState state = new StreamState()
{
Name = stream.Name,
Closed = stream.IsClosed,
Count = stream.Count,
InPoint = stream.InPoint
};
this.Streams.Add(state);
}
}
示例5: ProcessByState
private TaskState ProcessByState(Task processedTask, TaskState state)
{
//Global.Log ("Processing task of sequence (" + ToString () + "): " + processedTask.ToString() + " with state: " + state.ToString());
switch (state) {
case TaskState.Ready:
return ExecuteSubTask (processedTask);
case TaskState.Running:
return TaskState.Running;
case TaskState.Success:
processedTask.State = TaskState.Ready;
currentTaskIndex++;
if (currentTaskIndex >= SubTasks.Count) {
currentTaskIndex = 0;
return TaskState.Success;
}
return TaskState.Running;
case TaskState.Failed:
processedTask.State = TaskState.Ready;
//setting next task to first sub action
currentTaskIndex = 0;
return TaskState.Failed;
default:
//unexpected
return TaskState.Failed;
}
}
示例6: Task
internal Task(TaskManager taskManager, IEnumerator<IAsyncCall> callIterator)
{
this._waitCall = new AsyncCall<bool>();
this._taskManager = taskManager;
this._taskState = TaskState.Unstarted;
this._asyncCallIterator = callIterator;
}
示例7: TaskState
public TaskState(RemoteTask task, TaskState parentState, string message = "Internal Error (xunit runner): No status reported", TaskResult result = TaskResult.Inconclusive)
{
Task = task;
Message = message;
Result = result;
ParentState = parentState;
}
示例8: BuildData
public BuildData(string header)
{
Header = header;
Info = new ObservableCollection<Message>();
_state = TaskState.Normal;
ItemCount = new ObservableCollection<string>();
}
示例9: ScheduleTrigger
public ScheduleTrigger(TaskState state, ITrigger trigger, IDev2TaskService service, ITaskServiceConvertorFactory factory)
{
_service = service;
_factory = factory;
State = state;
Trigger = trigger;
}
示例10: GetState
public static IProcessingState GetState(TaskState state)
{
if (States.ContainsKey(state))
{
return States[state];
}
throw new ArgumentOutOfRangeException("state");
}
示例11: SetState
public void SetState(ITaskExecuteClient source, TaskState state, TaskMessage message)
{
this._state = state;
if (this.StateChanged != null)
{
this.StateChanged(source, this, message);
}
}
示例12: NotifyTaskStateChanged
private void NotifyTaskStateChanged(AsyncTask task, TaskState state)
{
var stateChangedHandler = TaskStateChanged;
if (stateChangedHandler == null)
return; // No event handler, bail.
var e = new TaskStateChangedEventArgs(task, state);
stateChangedHandler(this, e);
}
示例13: Task
internal Task(string name, Guid queueId)
{
this.Id = Guid.NewGuid();
this.QueueId = queueId;
this.Name = name;
this.State = TaskState.Queued;
this.OutstandingDependencies = new HashSet<Guid>();
this.DependantOn = new HashSet<Guid>();
this.DependencyTo = new HashSet<Guid>();
}
示例14: ChangeTaskState
public bool ChangeTaskState(TaskState destinationState)
{
bool isSuccess = _database.ChangeTaskState(_targetTask, destinationState);
if (isSuccess)
{
RefreshTaskList();
}
return isSuccess;
}
示例15: DummyTask
public DummyTask(DummyBackend backend, int id, string taskName)
{
this.backend = backend;
this.id = id;
this.name = taskName;
this.dueDate = DateTime.MinValue; // No due date specified
this.completionDate = DateTime.MinValue; // No due date specified
this.priority = TaskPriority.None;
this.state = TaskState.Active;
}