本文整理汇总了C#中System.Activities.Presentation.Model.ModelItem.GetTaskActivity方法的典型用法代码示例。如果您正苦于以下问题:C# ModelItem.GetTaskActivity方法的具体用法?C# ModelItem.GetTaskActivity怎么用?C# ModelItem.GetTaskActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Activities.Presentation.Model.ModelItem
的用法示例。
在下文中一共展示了ModelItem.GetTaskActivity方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanUnassign
public static bool CanUnassign(ModelItem source)
{
Contract.Requires(source != null);
var task = source.GetTaskActivity();
return task.Status != TaskActivityStatus.Editing;
}
示例2: CanMerge
public static bool CanMerge(ModelItem source)
{
Contract.Requires(source != null);
var task = source.GetTaskActivity();
return task.Status == TaskActivityStatus.CheckedIn;
}
示例3: CheckIsTask
public static bool CheckIsTask(ModelItem source)
{
Contract.Requires(source != null);
return source.GetTaskActivity() != null ? true : false;
}
示例4: UpdateTaskItem
private static void UpdateTaskItem(ModelItem source, WorkflowEditorViewModel workflowItem)
{
ModelItem taskModelItem = GetLastVersionActivity(source, workflowItem);
MergeTaskArgmentToParent(taskModelItem, workflowItem.WorkflowDesigner.GetRoot(), source);
CompositeService.UpdateModelItem(source, source.GetTaskActivity().CreateTaskActivity(taskModelItem));
}
示例5: GetXamlOfTaskBody
private static string GetXamlOfTaskBody(WorkflowDesigner rootDesigner, ModelItem taskItem)
{
TaskActivity taskActivity = taskItem.GetTaskActivity();
WorkflowDesigner bodyDesigner = CompositeService.CreateWorkflowDesigner(taskActivity.TaskBody,
new TaskAssignment() { TaskId = taskActivity.TaskId }.GetFriendlyName(((ActivityBuilder)rootDesigner.GetRoot().GetCurrentValue()).Name));
ModelItem rootItem = rootDesigner.GetRoot();
ModelItem bodyItem = bodyDesigner.GetRoot();
ArgumentService.AddArguments(bodyItem, rootItem);
List<Variable> variables = ArgumentService.GetAvailableVariables(taskItem).ToList();
ArgumentService.AddArguments(bodyItem,
variables.Select(v => new DynamicActivityProperty(){
Name = v.Name,
Type = typeof(InOutArgument<>).MakeGenericType(v.Type),
}));
return bodyDesigner.CompilableXaml();
}
示例6: GetLastVersionActivity
private static ModelItem GetLastVersionActivity(ModelItem source, WorkflowEditorViewModel workflowItem)
{
TaskActivity task = source.GetTaskActivity();
var result = TaskService.GetLastVersionTaskActivityDC(task.TaskId);
workflowItem.DownloadTaskDependency(result);
return CompositeService.CreateActivity(result.Activity.Xaml);
}
示例7: UnassignTask
public static void UnassignTask(ModelItem source)
{
Contract.Requires(source != null);
var updatedBody = source.GetTaskActivity().TaskBody;
if (updatedBody != null)
{
CompositeService.UpdateModelItem(source, updatedBody);
}
else
{
CompositeService.DeleteModelItem(source);
}
}