/// <summary> /// Lanza un evento /// </summary> private void RaiseEvent(TreeEventType intType, TreeNode trnNode) { if (IsNodeWithKey(trnNode)) { switch (intType) { case TreeEventType.LoadChildsEvent: // Limpia los hijos del nodo trnNode.Nodes.Clear(); // Carga los hijos if (LoadChilds != null) { LoadChilds(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); } break; case TreeEventType.NodeDoubleClickEvent: if (NodeDoubleClick != null) { NodeDoubleClick(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); } break; case TreeEventType.NodeDelete: if (NodeDelete != null) { NodeDelete(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); } break; } } }
/// <summary> /// Lanza un evento /// </summary> private void RaiseEvent(TreeEventType intType, TreeNode trnNode) { if (IsNodeWithKey(trnNode)) switch (intType) { case TreeEventType.LoadChildsEvent: // Limpia los hijos del nodo trnNode.Nodes.Clear(); // Carga los hijos if (LoadChilds != null) LoadChilds(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); break; case TreeEventType.NodeDoubleClickEvent: if (NodeDoubleClick != null) NodeDoubleClick(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); break; case TreeEventType.NodeDelete: if (NodeDelete != null) NodeDelete(this, new TreeViewExtendedEventArgs(trnNode, trnNode.Tag as TreeNodeKey)); break; } }
public TreeEventListener(Func <T, bool> onEvent, TreeEventType type) { this.onEvent = onEvent; this.EventType = type; }
public TreeEvent AddTreeEvent(EventTree eventTree, TreeEvent selectedTreeEventToAddTo, TreeEventType type) { var newTreeEvent = new TreeEvent { Name = "Nieuwe gebeurtenis" }; foreach (var expert in project.Experts) { foreach (var hydraulicCondition in project.HydraulicConditions) { newTreeEvent.ClassesProbabilitySpecification.Add(new ExpertClassEstimation { Expert = expert, HydraulicCondition = hydraulicCondition, AverageEstimation = ProbabilityClass.None, MinEstimation = ProbabilityClass.None, MaxEstimation = ProbabilityClass.None }); } } if (eventTree.MainTreeEvent == null) { eventTree.MainTreeEvent = newTreeEvent; eventTree.OnPropertyChanged(nameof(eventTree.MainTreeEvent)); return(newTreeEvent); } switch (type) { case TreeEventType.Failing: selectedTreeEventToAddTo.FailingEvent = newTreeEvent; selectedTreeEventToAddTo.OnPropertyChanged(nameof(selectedTreeEventToAddTo.FailingEvent)); break; case TreeEventType.Passing: selectedTreeEventToAddTo.PassingEvent = newTreeEvent; selectedTreeEventToAddTo.OnPropertyChanged(nameof(selectedTreeEventToAddTo.PassingEvent)); break; } return(newTreeEvent); }