private void Current_TaskActivitiesChangedEvent(object sender, TaskActivityEventArgs e) { if (e == TaskActivityEventArgs.Empty) { return; } _days = _engine.TaskActivitiesProvider.DiscoverDateMetrics( BritishMicro.TaskClerk.Providers.TaskActivitiesProvider.MetricQuestion.AvailableDays); if ((treeView.SelectedNode != null) && (treeView.SelectedNode.Tag != null)) { if (treeView.SelectedNode.Tag.GetType() == typeof(DateTime)) { if (e.TaskActivity.StartDate.ToShortDateString() != ((DateTime)treeView.SelectedNode.Tag).ToShortDateString()) { RebuildTree(treeView.SelectedNode.Name); } if (treeView.SelectedNode != null) { RefreshViews(treeView.SelectedNode.Tag); } } } else { RebuildTree(); } //_currentActivity = e.TaskActivity; UpdateStatusBarText(); }
void TaskActivitiesProvider_TaskActivitiesChanged(object sender, TaskActivityEventArgs e) { _isReadyForEdit = false; dateTimePickerStartDate.Text = e.TaskActivity.StartDate.ToLongDateString(); dateTimePickerStartTime.Text = e.TaskActivity.StartDate.ToString("HH:mm"); dateTimePickerEndDate.Text = e.TaskActivity.EndDate.ToLongDateString(); dateTimePickerEndTime.Text = e.TaskActivity.EndDate.ToString("HH:mm"); numericUpDown.Value = e.TaskActivity.Duration; _isReadyForEdit = true; }
private void Current_TaskActivitiesChangedEvent(object o, TaskActivityEventArgs e) { if (e != TaskActivityEventArgs.Empty) { if (e.TaskActivity.StartDate.ToShortDateString() == _effectiveDate.ToShortDateString()) { Activities = AppContext.Current.TaskActivitiesProvider.LoadActivities(_effectiveDate); dataGridView_CurrentCellChanged(this, EventArgs.Empty); } } }
/// <summary> /// Removes an activity. /// </summary> /// <param name="activity"></param> public void RemoveActivity(TaskActivity activity) { TaskActivityEventArgs taea = new TaskActivityEventArgs(activity); OnRemovingActivityEvent(taea); if (taea.Cancel == false) { DateTime timerStart = DateTime.Now; ProviderRemoveActivity(activity); RaiseTimingEvent(MethodInfo.GetCurrentMethod(), timerStart); OnTaskActivitiesChangedEvent(new TaskActivityEventArgs(activity)); } }
/// <summary> /// Starts an activity. /// </summary> /// <param name="activity">The activity.</param> public void BeginActivity(TaskActivity activity) { if (activity == null) { throw new ArgumentNullException("activity"); } TaskActivityEventArgs taea = new TaskActivityEventArgs(activity); OnBeginActivityEvent(taea); if (taea.Cancel == false) { DateTime timerStart = DateTime.Now; ProviderBeginActivity(taea.TaskActivity); RaiseTimingEvent(MethodInfo.GetCurrentMethod(), timerStart); OnTaskActivitiesChangedEvent(taea); } }
/// <summary> /// Handles the BeginningActivity event of the TaskActivitiesProvider control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> void TaskActivitiesProvider_BeginningActivity(object sender, TaskActivityEventArgs e) { TaskDescription description = e.TaskActivity.TaskDescription; MostRecentlyUsedItem targetItem = this._items.Find( delegate(MostRecentlyUsedItem item) { return(item.Id.Equals(description.Id)); }); if (targetItem == null) { targetItem = new MostRecentlyUsedItem(description.Id); } this._items.Remove(targetItem); this._items.Insert(0, targetItem); targetItem.Usage++; }
/// <summary> /// Raises the <see cref="E:RemovingActivityEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnRemovingActivityEvent(TaskActivityEventArgs e) { EventHandler<TaskActivityEventArgs> handler = RemovingActivity; if (handler != null) { handler(this, e); } }
/// <summary> /// Raises the <see cref="E:StartingActivityEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnBeginActivityEvent(TaskActivityEventArgs e) { BeginningActivity?.Invoke(this, e); }
/// <summary> /// Raises the <see cref="E:CompletingActivityEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnCompletingActivityEvent(TaskActivityEventArgs e) { CompletingActivity?.Invoke(this, e); }
private void Current_TaskActivitiesChangedEvent(object sender, TaskActivityEventArgs e) { if (e == TaskActivityEventArgs.Empty) { return; } _days = _engine.TaskActivitiesProvider.DiscoverDateMetrics( BritishMicro.TaskClerk.Providers.TaskActivitiesProvider.MetricQuestion.AvailableDays); if ((treeView.SelectedNode != null) && (treeView.SelectedNode.Tag != null)) { if (treeView.SelectedNode.Tag.GetType() == typeof (DateTime)) { if (e.TaskActivity.StartDate.ToShortDateString() != ((DateTime) treeView.SelectedNode.Tag).ToShortDateString()) { RebuildTree(treeView.SelectedNode.Name); } if (treeView.SelectedNode != null) { RefreshViews(treeView.SelectedNode.Tag); } } } else { RebuildTree(); } //_currentActivity = e.TaskActivity; UpdateStatusBarText(); }
/// <summary> /// Raises the <see cref="E:TaskActivitiesChangedEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnTaskActivitiesChangedEvent(TaskActivityEventArgs e) { EventHandler<TaskActivityEventArgs> handler = TaskActivitiesChanged; if (handler != null) { handler(this, e); } }
/// <summary> /// Raises the <see cref="E:RemovingActivityEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnRemovingActivityEvent(TaskActivityEventArgs e) { RemovingActivity?.Invoke(this, e); }
/// <summary> /// Raises the <see cref="E:StartingActivityEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnBeginActivityEvent(TaskActivityEventArgs e) { EventHandler<TaskActivityEventArgs> handler = BeginningActivity; if (handler != null) { handler(this, e); } }
/// <summary> /// Completes the activity. /// </summary> /// <param name="activity">The activity.</param> /// <param name="effectiveDate">The effective date.</param> public void CompleteActivity(TaskActivity activity, DateTime effectiveDate) { if (activity == null) { throw new ArgumentNullException("activity"); } TaskActivityEventArgs taea = new TaskActivityEventArgs(activity, effectiveDate); OnCompletingActivityEvent(taea); if (taea.Cancel == false) { DateTime timerStart = DateTime.Now; ProviderCompleteActivity(taea.TaskActivity); RaiseTimingEvent(MethodInfo.GetCurrentMethod(), timerStart); OnTaskActivitiesChangedEvent(new TaskActivityEventArgs(activity)); } }
/// <summary> /// Raises the <see cref="E:TaskActivitiesChangedEvent"/> event. /// </summary> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> private void OnTaskActivitiesChangedEvent(TaskActivityEventArgs e) { TaskActivitiesChanged?.Invoke(this, e); }