public static FormEdit GetFormEdit(IUMLElement element) { element.Load(); FormEdit form = null; if (dictionary.ContainsKey(element.Guid)) { form = dictionary[element.Guid] as FormEdit; } else { #region Create the form if (element is UMLUseCase) { form = new UseCaseEdit(element as UMLUseCase); } else if (element is UMLFlow) { form = new FlowEdit(element as UMLFlow); } else if (element is UMLIteration) { form = new IterationEdit(element as UMLIteration); } else if (element is UMLPhase) { form = new PhaseEdit(element as UMLPhase); } else if (element is UMLCollaboration) { form = new CollaborationEdit(element as UMLCollaboration); } else if (element is UMLFile) { form = new FileEdit(element as UMLFile); } #endregion #region Add to the dictionary if (form != null) { if (String.IsNullOrEmpty(element.Guid)) { dictionary.Add(Guid.NewGuid().ToString(), form); } else { dictionary.Add(element.Guid, form); } } #endregion } return(form); }
public static FormEdit GetFormEdit(IUMLElement element) { element.Load(); FormEdit form = null; if (dictionary.ContainsKey(element.Guid)) { form = dictionary[element.Guid] as FormEdit; } else { #region Create the form if (element is UMLUseCase) { form = new UseCaseEdit(element as UMLUseCase); } else if (element is UMLFlow) { form = new FlowEdit(element as UMLFlow); } else if (element is UMLIteration) { form = new IterationEdit(element as UMLIteration); } else if (element is UMLPhase) { form = new PhaseEdit(element as UMLPhase); } else if (element is UMLCollaboration) { form = new CollaborationEdit(element as UMLCollaboration); } else if (element is UMLFile) { form = new FileEdit(element as UMLFile); } #endregion #region Add to the dictionary if (form != null) { if (String.IsNullOrEmpty(element.Guid)) { dictionary.Add(Guid.NewGuid().ToString(), form); } else { dictionary.Add(element.Guid, form); } } #endregion } return form; }
private void form_FormSaved(object sender, EventArgs e) { UseCaseEdit usecaseForm = sender as UseCaseEdit; //TreeNode ownerNode = FindNode(this.treeView1.Nodes, usecaseForm.UseCase.Owner.Guid); //TreeNode node = ownerNode.Nodes[usecaseForm.UseCase.Guid]; TreeNode node = _treeNodes[usecaseForm.UseCase.Guid]; if (node == null) { TreeNode ownerNode = _treeNodes[usecaseForm.UseCase.Owner.Guid]; node = ownerNode.Nodes.Add(usecaseForm.UseCase.Guid, usecaseForm.UseCase.Name, "useCase", "useCase"); node.Tag = usecaseForm.UseCase; _treeNodes.Add(usecaseForm.UseCase.Guid, node); } treeView1.SelectedNode = node; }