public async Task <ActionResult <TaskItems> > PostTask(TaskItems taskitem) { _context.TaskItems.Add(taskitem); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetTask), new { id = taskitem.Id }, taskitem)); }
public async Task Run() { IsRunning = true; if (IsDisplayActivityIndicator == true) { activityIndicator.IsRunning = true; activityIndicator.IsVisible = true; } double counter = 0; double totalCounter = TaskItems.Sum(e => e.Wieght); foreach (var item in TaskItems) { double currentStep = counter / totalCounter; double currentPercentage = (currentStep * 100); CurrentPercentage = currentPercentage; lbl.Text = string.Format("{0} - (%{1})", item.TaskName, String.Format("{0:0.0}", currentPercentage)); item.Task.RunSynchronously(); await mainProgressBar.ProgressTo(currentStep, 0, Easing.Linear); counter = counter + item.Wieght; } IsRunning = false; activityIndicator.IsRunning = false; activityIndicator.IsVisible = false; }
private void ReAttachBoard(TaskItem taskItem) { TaskItems.Remove(SelectedTaskItem); TaskItems.AddSorted(taskItem, o => o.Name); SelectedTaskItem = taskItem; }
public Task(TaskItems _task = TaskItems.None, Vector3 _loc = default, GameObject _obj = default, bool _personal = false) { task = _task; //possible = _possible; location = _loc; obj = _obj; personal = _personal; }
private void RemoveCommandExecute(object obj) { if (base.ConfirmDeletion() == MessageBoxResult.Yes && boardService.Remove(SelectedTaskItem)) { TaskItems.Remove(SelectedTaskItem); } }
/// <summary> /// 查询任务 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SearchBtn_OnClick(object sender, RoutedEventArgs e) { TaskItems.Clear(); List <TaskInfo> allTaskInfos = tts.GetAllFinishedTaskInfo(); allTaskInfos.AddRange(tts.GetTaskWithName(SearchTextBox.Text)); TaskItems.AddRange(TransferTaskItemsFromTaskInfo(allTaskInfos)); UpdateView(false); }
public async Task <IActionResult> PutTask(int id, TaskItems item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public async void Reset() { await mainProgressBar.ProgressTo(0, 0, Easing.Linear); lbl.Text = "%0"; CurrentPercentage = 0; if (TaskItems != null) { TaskItems.Clear(); } }
private void UpdateView(bool showAllTask = true) { if (showAllTask) { TaskItems.Clear(); List <TaskInfo> allTaskInfos = tts.GetAllFinishedTaskInfo(); allTaskInfos.AddRange(tts.GetAllUnfinishedTaskInfos()); TaskItems.AddRange(TransferTaskItemsFromTaskInfo(allTaskInfos)); } AllTasksListView.Items.Refresh(); }
/// <summary> /// Starts new session out of current tasks /// </summary> private void StartTaskSession() { // Get tasks from Handler sorted like TaskItems var taskContexts = mTimeTasksMapper.MatchTaskOrder(TaskItems.Select(vm => vm as TimeTaskViewModel).ToList(), mSessionHandler.GetTasks().WholeList); // Pass it to the service mSessionHandler.UpdateTasks(taskContexts); // Create brand-new view model for session page var sessionViewModel = mViewModelProvider.GetInjectedPageViewModel <TasksSessionPageViewModel>(); sessionViewModel.InitializeSessionCommand.Execute(null); // Change to session page mApplicationViewModel.GoToPage(ApplicationPage.TasksSession, sessionViewModel); }
private void ShowEditWindow(TaskItem taskItem) { bool isNew = taskItem.ID == default(int); var editBoardItemsView = ControlFactory.CreateWindow <EditBoardItemViewModel>(); editBoardItemsView.WithDataContext <EditBoardItemViewModel>(o => o.CurrentTaskItem = taskItem); if (editBoardItemsView.ShowDialog() == true && isNew) { TaskItems.AddSorted(taskItem, o => o.Name); } else { ReAttachBoard(editBoardItemsView.GetDataContext <EditBoardItemViewModel>().CurrentTaskItem); } }
private async Task Refresh() { try { IsBusy = true; var userId = AccountHelper.GetCurrentUserId(); string userInternalId = await _userDataService.GetUserInternalId(userId, Constants.MainAuthenticationDomain); TaskItems = await _taskItemDataService.GetTaskItems(userInternalId); TaskItems = TaskItems.OrderBy(t => t.Name).ToObservableCollection(); } catch (Exception ex) { new MessageDialog(ex.Message).ShowAsync(); } IsBusy = false; }
/// <summary> /// Init constructor. /// </summary> public TaskListPane (DTE2 appObject) { if(appObject == null) throw new ArgumentException("Invalid application object", "appObject"); if (appObject.Windows != null) { taskWindow = appObject.Windows.Item(Constants.vsWindowKindTaskList) as Window2; if(taskWindow != null) { taskList = taskWindow.Object as EnvDTE.TaskList; if (taskList != null) { taskItems = taskList.TaskItems; taskItems2 = taskList.TaskItems as TaskItems2; } } } }
public void FirstTimeLoadOneArea() { TaskItems.Clear(); if (AllTaskItems == null) { return; } if (CurrentSelectArea == null) { return; } foreach (var t in AllTaskItems) { if (t.AreaId == CurrentSelectArea.Value) { TaskItems.Add(t); } } }
public void AddTask(string note, int index = -1) { var task = new TaskListItem() { Description = note, State = TaskListItemState.Waiting }; if (index < 0) { TaskItems.Add(task); } else { TaskItems.Insert(index, task); if (CursorIndex > index) { CursorIndex++; } } }
public void SetFocus(int value, TaskItems focus) { for (int i = 0; i < 3; i++) { if (i == value) { continue; } if (GetFocus[i] == TaskItems.None) { continue; } if (focus == GetFocus[i]) { GetFocus[i] = GetFocus[value]; } } GetFocus[value] = focus; ReorderFocuses(); }
public void LoadOneArea() { var tmp = new List <EventTaskItemViewModel>(); TaskItems.Clear(); if (AllTaskItems == null) { return; } if (CurrentSelectArea == null) { return; } foreach (var t in AllTaskItems) { if (t.AreaId == CurrentSelectArea.Value) { TaskItems.Add(t); } } }
/// <summary> /// Reorders the task list when an item is moved /// </summary> /// <param name="param">The from-to positions provided as Tuple of two ints</param> private void Reorder(object param) { // Get tuple from our parameter if (!(param is Tuple <int, int> positions)) { // Throw an exception because we explicitely say its Tuple in the code, so something must've gone seriously wrong throw new Exception(LocalizationResource.AttemptToReorderTasksNoPosition); } // Extract from and to positions from the tuple var posFrom = positions.Item1; var posTo = positions.Item2; // Prepare list of the new order var orderList = new List <int>(); // Loop each index for (var i = 0; i < TaskItems.Count; i++) { // If its not posFrom if (i != posFrom) { // Just add the index orderList.Add(i); } } // Now we have the whole list in the order without posFrom item, so add it in the proper place orderList.Insert(posTo, posFrom); // Reorder the task items by the order list we prepared var reorderedList = orderList.Select(item => TaskItems.ElementAt(item)).ToList(); // Replace old list with reordered one TaskItems = new ObservableCollection <SummaryTimeTaskItemViewModel>(reorderedList); }
public void RefreshItems(object sender, EventArgs e) { TaskItems.Clear(); TaskItems = FakeRepo.GetTaskForCurentDate(CurentDateDay); DoListItemsChanged(); }
public TaskItemCollectionNodeFactory(TaskItems tasks) { _tasks = tasks; }
public TaskItemCollectionNodeFactory(TaskItems tasks) { _tasks = tasks; }
/// <summary> /// オブジェクトが指定の名前空間とクラス名なら分析 /// </summary> /// <param name="t">比較対象のオブジェクト</param> /// <param name="strNameSpace">指定の名前空間</param> /// <param name="strClassName">指定のクラス名</param> static bool AnalyzeAssembly(Type t, string strNameSpace, string strClassName) { // 通常のネームスペース系 var cond1 = (t.Namespace == strNameSpace || strNameSpace == "any" || strNameSpace == "NONE") && t.Name == strClassName; // ネームスペースとクラス名のそれぞれは一致しないのに、合算すると一致するということは… // ネストクラスになっている可能性がある。これはTypeScriptでは表現できない。 var fullname1 = t.FullName.Replace("+", "."); var fullname2 = strNameSpace + "." + strClassName; var cond2 = fullname1 == fullname2; string _ns = t.Namespace; // 通常の条件は満たさないが、名前空間とクラス名を全部くっつけると一致する場合は、TypeScriptで実現できないので // ちょっと構造を変えてパッチ。クラスも1つ名前空間としてしまう if (!cond1 && cond2) { _ns = strNameSpace; } if (cond1 || cond2) { if (_ns == null || _ns == "") { _ns = "NONE"; // NameSpaceはちゃんと存在するのに、NONE指定ならやらない } else if (strNameSpace == "NONE") { return(false); } // 対象の「名前空間、クラス名」の組み合わせはすでに、出力済み? var item = TaskItems.Find((tsk) => { return(tsk.strClassName == t.Name && tsk.strNameSpace == _ns); }); // すでに登録済みで、すでに処理済み if (item != null && item.Status >= TaskItem.DoStatus.Done) { return(false); } // まだなので、新たなタスクを作る。今からこのまま実行するので「済状態」を同時に付ける if (item == null) { item = new TaskItem { strNameSpace = _ns, strClassName = t.Name, Status = TaskItem.DoStatus.Done }; TaskItems.Add(item); } else { item.Status = TaskItem.DoStatus.Done; } var nsList = GetNameSpaceNestedData(_ns); PrintClassCommentLabel(t, _ns, nsList); return(true); } return(false); }
/// <summary> /// Takes a TaskItemModel and inserts it into the page's collection of TaskItems that are /// being displayed. Allows the ViewTasks Use-Case to update the TaskItems being displayed. /// </summary> /// <param name="source"> /// The source of the event. Unused. /// </param> /// <param name="taskItemModel"> /// To be added to the page's collection of TaskItemModels /// </param> public void TaskCreatedCallback(object source, TaskItemModel taskItemModel) { TaskItems.Add(taskItemModel); }
public void CreateTaskItem() { TaskItems.Add(new TaskItem(this)); }
//Bliver kaldt når du åbner en grundplan som kalenderplan. //public void SetRelevantTasks(List<TaskItem> taskItems) //{ // taskItems.Add(new TaskItem()); // TaskItems = taskItems; // TaskItems = GetTasks(t => CheckIfRelevant(t)); //} //private bool CheckIfRelevant(TaskItem taskItem) //{ // return (EffectiveDate - taskItem.FirstTimeLoaded).Days % taskItem.TaskDescription.Frequency == 0; //} //Input is delegate function etc. t => "t.startTime > 12.00" public List <TaskItem> GetTasks(Predicate <TaskItem> Filter) { return(TaskItems.FindAll(t => Filter(t))); }