Пример #1
0
        private void TasksLog_LogChanged(Logs.LogChangeEventArgs e)
        {
            if (this.InvokeRequired)
            {
                TasksLog_LogChangedDelegate d = new TasksLog_LogChangedDelegate(TasksLog_LogChanged);
                this.Invoke(d, new object[] { e });
            }
            else
            {
                Task taskRow;
                if (e.Action == DataRowAction.Change)
                {
                    if (e.Log.InsertTime.Date != this.currentDay)
                    {
                        return;
                    }

                    taskRow = Tasks.FindById(e.Log.TaskId);
                    foreach (TreeListViewItem item in this.taskList.Items)
                    {
                        if (((Log)item.Tag).Id == e.Log.Id)
                        {
                            SetListItemValues(item, e.Log, taskRow);
                            break;
                        }
                    }
                }
                else if (e.Action == DataRowAction.Add)
                {
                    CheckCurrentDayChanged();
                    if (this.logDate.Value.Date == currentDay)
                    {
                        //unbold no current log font.
                        foreach (TreeListViewItem item in this.taskList.Items)
                        {
                            if (item.Font.Bold && Logs.CurrentLog != null && ((Log)item.Tag).Id != Logs.CurrentLog.Id)
                            {
                                item.Font = new Font(item.Font, FontStyle.Regular);
                                break;
                            }
                        }

                        taskRow = Tasks.FindById(e.Log.TaskId);
                        TreeListViewItem itemA = new TreeListViewItem("", new string[] { "", "" });
                        itemA.Font = new Font(itemA.Font, FontStyle.Bold);
                        SetListItemValues(itemA, e.Log, taskRow);
                        taskList.Items.Insert(0, itemA);
                    }
                }
                if (e.Log.Id == Logs.CurrentLog.Id)
                {
                    UpdateNotifyIcon();
                }
                DisplaySelectedItemStatus();
            }
        }
Пример #2
0
 private void TasksLog_LogChanged(Logs.LogChangeEventArgs e)
 {
     if (e.Action == DataRowAction.Add)
     {
         tasksLogRowChangedEvent_RowAddedCount++;
     }
     else if (e.Action == DataRowAction.Change)
     {
         tasksLogRowChangedEvent_RowUpdatedCount++;
     }
 }