void CountTasks(bl_DevNotesInfo notes) { CompletedTaks.Clear(); MaxCatCount = 0; for (int i = 0; i < notes.HistoryNotes.Count; i++) { if (CompletedTaks.Exists(x => x.CatID == notes.HistoryNotes[i].CategoryID)) { TaskCount tc = CompletedTaks.Find(x => x.CatID == notes.HistoryNotes[i].CategoryID); tc.Completed++; if (tc.Completed > MaxCatCount) { MaxCatCount = tc.Completed; } } else { TaskCount tc = new TaskCount(); tc.CatID = notes.HistoryNotes[i].CategoryID; tc.Completed = 1; tc.Build(notes); CompletedTaks.Add(tc); } } MaxCatCount += 5; }
public async Task <TaskCount> AddTaskCountAsync(TaskCount taskCount, CancellationToken cancellationToken = default) { this.context.TaskCounts.Add(taskCount); await this.context.SaveChangesAsync(cancellationToken); return(taskCount); }
protected void DrawTasks(Graphics g) { if (TaskCount > 0) { g.DrawImageUnscaled(TaskImage, new Point(Center.X + 25, Center.Y - 5)); g.DrawString(TaskCount.ToString(), new Font(FontFamily.GenericSansSerif, 10), Brushes.Black, Center.X + 40, Center.Y - 5); } }
public void Reset(TaskCount taskCount) { var leftGaps = Math.Max(0, Math.Min(taskCount.Gaps, taskCount.LeftGaps)); var rightGaps = Math.Max(taskCount.Gaps - leftGaps, 0); gapSides.Reset(leftGaps, rightGaps); var leftOverlaps = Math.Max(0, Math.Min(taskCount.Overlaps, taskCount.LeftOverlaps)); var rightOverlaps = Math.Max(taskCount.Overlaps - leftOverlaps, 0); overlapSides.Reset(leftOverlaps, rightOverlaps); }
public void AddGameTask(Guid guid, TaskCount count, string name, string path, string arguments) { if (EnvironmentSettings.Current.OSVersion.Major >= 6) { if (Success != CreateTask(GameInstallScope.AllUsers, ref guid, TaskType.SupportTask, (uint)count, name, path, arguments)) { throw new Exception("unable to add task to task explorer."); } } }
public async Task ExecuteAsync(CancellationToken cancellationToken) { var tasks = await this.client.GetTasksAsync(cancellationToken); int count = tasks.Count; var taskCount = new TaskCount() { Count = count, Timestamp = this.dateTimeProvider.UtcNow }; await this.repository.AddTaskCountAsync(taskCount, cancellationToken); }
public void AddGameTask(Guid guid, TaskCount count, string name, string path, string arguments) { }
private void SetTask() { lblTask.Text = "Task " + TaskNum.ToString() + "/" + TaskCount.ToString() + ": " + TaskName + "..."; Refresh(); }