Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }