本文整理汇总了C#中ITask类的典型用法代码示例。如果您正苦于以下问题:C# ITask类的具体用法?C# ITask怎么用?C# ITask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITask类属于命名空间,在下文中一共展示了ITask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Add
public void Add(ITask task)
{
if (task == null)
throw new ArgumentNullException();
Add(new EnumerableTask(task));
}
开发者ID:adahera222,项目名称:TaskRunner,代码行数:7,代码来源:Tasks.cs
示例2: TaskLoggingHelperExtension
/// <summary>
/// public constructor
/// </summary>
public TaskLoggingHelperExtension(ITask taskInstance, ResourceManager primaryResources, ResourceManager sharedResources, string helpKeywordPrefix) :
base(taskInstance)
{
this.TaskResources = primaryResources;
this.TaskSharedResources = sharedResources;
this.HelpKeywordPrefix = helpKeywordPrefix;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:10,代码来源:TaskLoggingHelperExtension.cs
示例3: TaskViewModel
protected TaskViewModel(ILogger logger, ITask task, string name, string description, object icon)
{
if (logger == null)
throw new ArgumentNullException("logger");
if (task == null)
throw new ArgumentNullException("task");
if (name == null)
throw new ArgumentNullException("name");
if (description == null)
throw new ArgumentNullException("description");
if (icon == null)
throw new ArgumentNullException("icon");
this.logger = logger;
this.task = task;
this.name = name;
this.description = description;
this.icon = icon;
task.AddStoppedCallback(() => OnStopped());
task.AddCancelledCallback(() => OnCancelled());
task.AddCompletedCallback(() => OnCompleted());
task.AddErrorCallback(error => OnError(error));
task.AddFailedCallback(() => OnFailed());
task.AddPausedCallback(() => OnPaused());
task.AddProgressCallback(progress => OnProgressChanged(progress));
task.AddItemChangedCallback(item => OnItemChanged(item));
task.AddResumedCallback(() => OnResumed());
task.AddStartedCallback(() => OnStarted());
}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:30,代码来源:TaskViewModel.cs
示例4: GetV1Path
internal static string GetV1Path(ITask v1Task)
{
var ppszFileName = string.Empty;
try { ((IPersistFile)v1Task).GetCurFile(out ppszFileName); }
catch (Exception ex) { throw ex; }
return ppszFileName;
}
开发者ID:BclEx,项目名称:AdamsyncEx,代码行数:7,代码来源:Task.cs
示例5: FillTask
private void FillTask(ITask task)
{
questionSpelling.Content = task.Question.Spelling;
questionTranscription.Content = task.Question.Transcription;
answers.ItemsSource = task.Answers;
answers.ItemContainerStyleSelector = BuildStyleSelector(false);
}
开发者ID:EugeneSqr,项目名称:VocabExt.Desktop,代码行数:7,代码来源:TaskPanel.xaml.cs
示例6: ContainsTask
public bool ContainsTask(ITask task)
{
if(task.Category is DummyCategory)
return (task.Category.Name.CompareTo(name) == 0);
else
return false;
}
开发者ID:nolith,项目名称:tasque,代码行数:7,代码来源:DummyCategory.cs
示例7: ContainsTask
public bool ContainsTask(ITask task)
{
if(task.Category is RtmCategory)
return ((task.Category as RtmCategory).ID.CompareTo(ID) == 0);
else
return false;
}
开发者ID:nolith,项目名称:tasque,代码行数:7,代码来源:RtmCategory.cs
示例8: LogTaskState
public void LogTaskState(ITaskExecuteClient client, ITask task, TaskMessage message)
{
//��������Լ�¼��־
if (this.Storage != null)
this.Storage.SaveTaskChangedState(task, message);
}
开发者ID:ReinhardHsu,项目名称:devfw,代码行数:7,代码来源:TaskLogProvider.cs
示例9: Execute
public IResponse Execute(ITask task)
{
Debug.WriteLine(string.Format("{0}: Received task", DateTime.Now));
bool successful = true;
Exception exception = null;
IResult result = null;
try
{
ITaskExecutor taskExecutor = taskExecuterFactory.CreateExecuterFor(task);
Debug.WriteLine(string.Format("{0}: Executing {1}", DateTime.Now, task.GetType().Name));
result = taskExecutor.Execute(task);
}
catch(Exception e)
{
Debug.WriteLine(string.Format("{0}: Error in {1}, {2} ({3})", DateTime.Now, task.GetType().Name, e.GetType().Name, e.Message));
successful = false;
exception = e;
logger.LogException(LogLevel.Debug, "Exception when executing task: " + task.GetType().Name, e);
}
var resultType = task.GetType().GetInterfaces().Single(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof (ITask<>)).GetGenericArguments()[0];
return CreateResponse(resultType, result, successful, exception);
}
开发者ID:larsudengaard,项目名称:deploy-commander,代码行数:25,代码来源:SoldierService.cs
示例10: Execute
public TaskContext Execute(ITask task, object associatedData = null)
{
var context = new TaskContext(task, associatedData);
_dispatcher.BeginInvoke(() =>
{
_all.Add(task);
_contexts.Add(context);
UpdateBusy();
});
task.Execute(context).ContinueWith((p, d) =>
{
_dispatcher.BeginInvoke(() =>
{
_all.Remove(task);
_contexts.Remove(context);
UpdateBusy();
});
}).Failed((p, d) =>
{
});
return context;
}
开发者ID:LenFon,项目名称:Bifrost,代码行数:27,代码来源:Tasks.cs
示例11: Compare
/// <summary>
/// This is the same as CompareTo above but should use completion date
/// instead of due date. This is used to sort items in the
/// CompletedTaskGroup.
/// </summary>
/// <returns>
/// whether the task has lower, equal or higher sort order.
/// </returns>
public override int Compare(ITask x, ITask y)
{
bool isSameDate = true;
if (x.CompletionDate.Year != y.CompletionDate.Year
|| x.CompletionDate.DayOfYear != y.CompletionDate.DayOfYear)
isSameDate = false;
if (!isSameDate) {
if (x.CompletionDate == DateTime.MinValue) {
// No completion date set for some reason. Since we already
// tested to see if the dates were the same above, we know
// that the passed-in task has a CompletionDate set, so the
// passed-in task should be "higher" in the sort.
return 1;
} else if (y.CompletionDate == DateTime.MinValue) {
// "this" task has a completion date and should evaluate
// higher than the passed-in task which doesn't have a
// completion date.
return -1;
}
return x.CompletionDate.CompareTo (y.CompletionDate);
}
// The completion dates are the same, so no sort based on other
// things.
return CompareByPriorityAndName (x, y);
}
开发者ID:GNOME,项目名称:tasque,代码行数:36,代码来源:TaskCompletionDateComparer.cs
示例12: AssertExecutableIs
public TaskDefinitionAssertions AssertExecutableIs(ITask<object> task)
{
AssertDefined();
Assert.That(TaskWithBehaviors.Task, Is.EqualTo(task));
return this;
}
开发者ID:rosaliafx,项目名称:Rosalia,代码行数:7,代码来源:TaskDefinitionsMapExtensions.cs
示例13: Send
public void Send(ITask task)
{
if (!this.running)
this.Start();
this.queue.Enqueue(task);
}
开发者ID:ajlopez,项目名称:AjActors,代码行数:7,代码来源:BaseActor.cs
示例14: Process
public void Process(object o, ITask task)
{
string path = BasePath + "/" + task.Identify + "/";
try
{
string filename;
var key = o as IHasKey;
if (key != null)
{
filename = path + key.Key + ".json";
}
else
{
//check
filename = path + Encrypt.Md5Encrypt(o.ToString()) + ".json";
}
FileInfo file = GetFile(filename);
using (StreamWriter printWriter = new StreamWriter(file.OpenWrite(), Encoding.UTF8))
{
printWriter.WriteLine(JsonConvert.SerializeObject(o));
}
}
catch (Exception e)
{
_logger.Warn("write file error", e);
throw;
}
}
开发者ID:hwpayg,项目名称:DotnetSpider,代码行数:28,代码来源:JsonFilePageModelPipeline.cs
示例15: QueueTask
public void QueueTask(ITask task)
{
Task newTask = new Task(delegate () {
task.Execute();
});
newTask.RunSynchronously(this);
}
开发者ID:maxrogoz,项目名称:COSystemArchitect,代码行数:7,代码来源:TaskQueue.cs
示例16: PeriodicalTaskRunner
public PeriodicalTaskRunner(ITask task, int frequency, DateTime lastRun)
{
Task = task;
_frequency = frequency;
_lastRun = lastRun;
_nextRun = _lastRun.AddSeconds(_frequency);
}
开发者ID:codesoda,项目名称:Scheduler,代码行数:7,代码来源:PeriodicalTaskRunner.cs
示例17: TaskMainToTaskMainDTO
private static TaskMainDTO TaskMainToTaskMainDTO(ITask param)
{
TaskMainDTO target = new TaskMainDTO();
target.TaskID = param.TaskID;
target.TargetVersion = param.TargetVersion;
target.Summary = param.Summary;
target.SubtaskType = param.SubtaskType;
target.Status = param.Status;
target.Project = param.Project;
target.Product = param.Product;
target.Priority = param.Priority;
target.Source = param.Source;
target.Estimation = param.Estimation;
target.Description = param.Description;
target.CreatedDate = param.CreatedDate;
target.CreatedBy = param.CreatedBy;
target.Comments = param.Comments;
target.TokenID = param.TokenID;
target.LinkToTracker = param.LinkToTracker;
if (param.TaskParent != null)
{
target.TaskParent = TaskMainToTaskMainDTO(param.TaskParent);
}
if (param.Assigned != null)
{
target.Assigned = UserToUserDTO(param.Assigned);
}
return target;
}
开发者ID:espressomorte,项目名称:Supakull,代码行数:33,代码来源:ConverterDomainToDTO.cs
示例18: Process
public void Process(ResultItems resultItems, ITask task)
{
foreach (DictionaryEntry entry in resultItems.GetAll())
{
System.Console.WriteLine(entry.Key + ":\t" + entry.Value);
}
}
开发者ID:hwpayg,项目名称:DotnetSpider,代码行数:7,代码来源:ConsolePipeline.cs
示例19: OnProcess
/// <summary>
///
/// </summary>
/// <param name="task"></param>
/// <param name="pr"></param>
public override void OnProcess(ITask task, IParseResult pr)
{
if (pr.IsSuccess)
{
string opera = task.Opera.Name;
if (StringHelper.Equal(opera, XD1100OperaNames.ReadReal))
{
ProcessReadReal(task, pr);
}
else if( StringHelper.Equal ( opera, XD1100OperaNames.ReadStatus ))
{
ProcessReadStatus(task, pr);
}
else if (
(StringHelper.Equal(opera, XD1100OperaNames.WriteOT)) ||
(StringHelper.Equal(opera, XD1100OperaNames.WriteOTMode)) ||
(StringHelper.Equal(opera, XD1100OperaNames.OPERA_READ)) ||
(StringHelper.Equal(opera, XD1100OperaNames.OPERA_WRITE))
)
{
}
else
{
string s = string.Format("not process xd1100 opera '{0}'", opera);
throw new NotImplementedException(s);
}
}
}
开发者ID:hkiaipc,项目名称:C3,代码行数:34,代码来源:XD1100DeviceProcessor.cs
示例20: Else
public static ITask Else(this ITask task, Func<bool> predicate, ITask elseTask)
{
Contract.Requires(task != null);
Contract.Requires(predicate != null);
return new TaskBranched(task, elseTask, predicate);
}
开发者ID:nbouilhol,项目名称:bouilhol-lib,代码行数:7,代码来源:TaskExtensions.cs
注:本文中的ITask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论