//private enum StatisticsControlWorks : int //{ // GetTaskStatistics //} private static TaskStatisticsResult GetTaskStatistics(TaskStatisticsArgs args) { TaskStatisticsResult result = new TaskStatisticsResult(); result.AppsSummaryList = ApplicationSummaries.GetApplicationsSummary( args.ParentId, args.FromDate, args.ToDate); return(result); }
private void GetTaskDetails(TaskStatisticsResult result) { try { this.applicationsList.BeginUpdate(); this.applicationsList.Items.Clear(); int appActiveTime = 0; foreach (ApplicationSummary applicationsSummaryRow in result.AppsSummaryList) { appActiveTime += (int)applicationsSummaryRow.TotalActiveTime; } foreach (ApplicationSummary applicationsSummaryRow in result.AppsSummaryList) { TimeSpan active = new TimeSpan(0, 0, (int)applicationsSummaryRow.TotalActiveTime); string activeTime = ViewHelper.TimeSpanToTimeString(active); double percent = 0; if (appActiveTime > 0) { percent = applicationsSummaryRow.TotalActiveTime / appActiveTime; } TreeListViewItem lvi = new TreeListViewItem(applicationsSummaryRow.Name, new string[] { activeTime, percent.ToString("0.0%", CultureInfo.InvariantCulture), applicationsSummaryRow.TaskId.ToString(CultureInfo.InvariantCulture) }); lvi.ImageIndex = IconsManager.GetIconFromFile(applicationsSummaryRow.ApplicationFullPath); this.applicationsList.Items.Add(lvi); } AppsActiveTimeValue.Text = ViewHelper.TimeSpanToTimeString(new TimeSpan(0, 0, appActiveTime)); } finally { this.applicationsList.EndUpdate(); SetReadyState(); } }
//private enum StatisticsControlWorks : int //{ // GetTaskStatistics //} private static TaskStatisticsResult GetTaskStatistics(TaskStatisticsArgs args) { TaskStatisticsResult result = new TaskStatisticsResult(); result.AppsSummaryList = ApplicationSummaries.GetApplicationsSummary( args.ParentId, args.FromDate, args.ToDate); return result; }
private void GetTaskDetails(TaskStatisticsResult result) { try { this.applicationsList.BeginUpdate(); this.applicationsList.Items.Clear(); int appActiveTime = 0; foreach (ApplicationSummary applicationsSummaryRow in result.AppsSummaryList) { appActiveTime += (int) applicationsSummaryRow.TotalActiveTime; } foreach (ApplicationSummary applicationsSummaryRow in result.AppsSummaryList) { TimeSpan active = new TimeSpan(0, 0, (int) applicationsSummaryRow.TotalActiveTime); string activeTime = ViewHelper.TimeSpanToTimeString(active); double percent = 0; if (appActiveTime > 0) percent = applicationsSummaryRow.TotalActiveTime/appActiveTime; TreeListViewItem lvi = new TreeListViewItem(applicationsSummaryRow.Name, new string[] { activeTime, percent.ToString("0.0%", CultureInfo.InvariantCulture), applicationsSummaryRow.TaskId.ToString(CultureInfo.InvariantCulture) }); lvi.ImageIndex = IconsManager.GetIconFromFile(applicationsSummaryRow.ApplicationFullPath); this.applicationsList.Items.Add(lvi); } AppsActiveTimeValue.Text = ViewHelper.TimeSpanToTimeString(new TimeSpan(0, 0, appActiveTime)); } finally { this.applicationsList.EndUpdate(); SetReadyState(); } }