本文整理汇总了C#中TaskItem类的典型用法代码示例。如果您正苦于以下问题:C# TaskItem类的具体用法?C# TaskItem怎么用?C# TaskItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskItem类属于命名空间,在下文中一共展示了TaskItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: refresh
public void refresh(TaskItem item)
{
templateID = item.templateID;
type = item.type;
TaskName.text = item.name;
TaskDes.text = item.decribe;
if(type == (int)GlobalDef.TaskType.T_ONECE)
{
Title.spriteName = "08";
}
else if(type == (int)GlobalDef.TaskType.T_EVERTYDAY)
{
Title.spriteName = "07";
}
// if(item.isFinish())
// {
// Finish.gameObject.SetActive(true);
// }
// else
// {
// Finish.gameObject.SetActive(false);
// }
}
示例2: IsTaskReadyToExecute
internal bool IsTaskReadyToExecute(TaskItem task)
{
if (task == null) return false;
var req = task.SystemData as TaskRequest;
if (req == null) return true;
return (req.LastAttempt + AttemptInterval <= DateTime.UtcNow);
}
示例3: NeedWaitTask
internal TimeSpan NeedWaitTask(TaskItem task)
{
TimeSpan timespan = TimeSpan.Zero;
if (task == null) return timespan;
var req = task.SystemData as TaskRequest;
if (req == null) return timespan;
return (req.LastAttempt + AttemptInterval) - DateTime.UtcNow;
}
示例4: Replace
public void Replace (TaskItem inner)
{
if (inner != Inner)
{
DisposeInner();
Inner = inner;
}
}
示例5: createTaskButton_Click
private void createTaskButton_Click(object sender, RoutedEventArgs e)
{
TaskItem newtask = new TaskItem()
{
AlertTime = new TimeSpan(13, 0, 0).ToString(),
DueTime = new TimeSpan(13, 0, 0).ToString(),
EscalationLevel1Time = new TimeSpan(13, 0, 0).ToString(),
AssetCategoryID = 116,
BusinessAreaID = 30,
BypassManagerApproval = false,
ChecklistID = 2,
Comments = "No comments",
Description = "Task2_Description",
DocumentURL = "",
FrequencyID = 7,
FunctionalID = null,
KeyControl = false,
LocationID = 48,
ManagerSelfApproval = false,
RandomFrequencyID = null,
SpecificFrequencyID = null,
TaskName = "Task2",
HolidayCalendar = true
};
List<User> taskassignees = new List<User>() { new User() {
BRID = "E20037236",
UserLoginID = "ghoshnil"
} };
List<User> taskmanagers = new List<User>() { new User() {
BRID = "G47969783",
UserLoginID = "mistryna"
} };
newtask.Assignees = taskassignees;
newtask.Managers = taskmanagers;
var request = new RestRequest("CreateTask", RestSharp.Method.POST) { RequestFormat = DataFormat.Json }.AddBody(newtask);
checcklistadminclient.ExecuteAsync(request, (response) =>
{
if (response.ResponseStatus == ResponseStatus.Error)
{
int i = 1;
}
else
{
var result = JsonConvert.DeserializeObject<List<TaskItem>>(response.Content);
int i = 1;
}
});
}
示例6: addTask
/// <summary>
/// 添加任务
/// </summary>
public void addTask(TaskItem task)
{
if(taskDict.ContainsKey(task.templateID))
{
Debug.LogError("already has this task!");
return;
}
taskDict.Add(task.templateID, task);
}
示例7: EditTaskItem
public EditTaskItem(ICollectionView view, TaskItem taskItem)
{
InitializeComponent();
this.DataContext = taskItem;
_view = view;
_taskItem = taskItem;
this.Loaded += OnEditTaskItemLoaded;
this.Closed += OnClosed;
}
示例8: ExecuteTask
internal virtual void ExecuteTask(TaskItem task)
{
if (task == null) return;
try
{
task.Task(task.UserData);
}
catch
{
}
}
示例9: AddDataItem
public void AddDataItem(TaskItem newDataItem)
{
// Add a to-do item to the data context.
dataDB.Items.InsertOnSubmit(newDataItem);
// Save changes to the database.
dataDB.SubmitChanges();
// Add a to-do item to the "all" observable collection.
AllDataItems.Add(newDataItem);
}
示例10: DesignDetailsViewModel
public DesignDetailsViewModel()
: base(null, null)
{
TaskItem = new TaskItem()
{
Title = "Sample Task",
Description = "Description of the Sample Task",
CreatedDate = DateTime.Now,
DueDate = DateTime.Now.AddDays(1),
Priority = Priority.Medium
};
}
示例11: SaveItemButton_Click
private void SaveItemButton_Click(object sender, RoutedEventArgs e)
{
if (!String.IsNullOrEmpty(ItemName.Text) && !String.IsNullOrEmpty(ItemDescription.Text)
&& comboBox.SelectedIndex > -1)
{
TaskItem saveItem = new TaskItem(ItemName.Text, ItemDescription.Text);
saveItem.startTime = ItemStartDate.Date.DateTime + ItemStartTime.Time;
saveItem.endTime = ItemEndDate.Date.DateTime + ItemEndTime.Time;
App.tasksManager.sections[comboBox.SelectedIndex].AddItem(saveItem);
App.tasksManager.saveToFile();
saveItem = null;
this.Frame.Navigate(typeof(TaskItemView), App.tasksManager.sections[comboBox.SelectedIndex]);
}
}
示例12: DueDate
public void DueDate()
{
PropertiesChanged = new List<String>();
var dueDate = DateTime.Now;
var taskItem = new TaskItem();
taskItem.PropertyChanged += OnPropertyChanged;
taskItem.DueDate = dueDate;
taskItem.PropertyChanged -= OnPropertyChanged;
Assert.AreEqual(dueDate, taskItem.DueDate, "DueDate");
Assert.IsTrue(PropertiesChanged.Contains("DueDate"), "DueDate Property Changed");
}
示例13: Description
public void Description()
{
PropertiesChanged = new List<String>();
var description = Guid.NewGuid().ToString();
var taskItem = new TaskItem();
taskItem.PropertyChanged += OnPropertyChanged;
taskItem.Description = description;
taskItem.PropertyChanged -= OnPropertyChanged;
Assert.AreEqual(description, taskItem.Description, "Description");
Assert.IsTrue(PropertiesChanged.Contains("Description"), "Description Property Changed");
}
示例14: addTempData
public void addTempData()
{
for(int i = 0; i < 5; i++)
{
TaskItem item = new TaskItem();
item.templateID = 800001 + i;
everyDayTask.addTask(item);
TaskItem item1 = new TaskItem();
item1.templateID = 800001 + i;
mainThreadTask.addTask(item1);
}
}
示例15: DeleteTask
public void DeleteTask()
{
var taskItem = new TaskItem();
var expectedTasks = new ObservableCollection<TaskItem>();
expectedTasks.Add(taskItem);
TaskRepository.Tasks = expectedTasks;
var args = new ExecuteEventArgs() { MethodParameter = taskItem };
ViewModel.DeleteTask(null, args);
var actualTasks = ViewModel.Tasks;
Assert.IsFalse(actualTasks.Contains(taskItem));
}