Ejemplo n.º 1
0
        /// <summary>
        /// Renames controller's associated element
        /// </summary>
        /// <typeparam name="ElementType">The type of the element.</typeparam>
        /// <param name="element">The element.</param>
        /// <param name="newName">new name for the element</param>
        /// <param name="controller">The controller that will issue renaming command.</param>
        /// <param name="containingCollection">Collection of elements of which element is a member.
        /// Can be left to null. If not null, it is checked, whether <paramref name="newName"/> is unique
        /// in the collection.</param>
        public static void RenameElement <ElementType>(ElementType element, string newName, ModelController controller, IEnumerable <ElementType> containingCollection)
            where ElementType : NamedElement
        {
            RenameElementCommand <ElementType> command = (RenameElementCommand <ElementType>) RenameElementCommandFactory <ElementType> .Factory().Create(controller);

            command.RenamedElement       = element;
            command.ContainingCollection = containingCollection;
            command.NewName = newName;
            command.Execute();
        }
Ejemplo n.º 2
0
        public static void ChangeOntologyEquivalent(NamedElement element, string newOntoEquiv, ModelController controller)
        {
            ChangeOntologyEquivalentCommand command = ChangeOntologyEquivalentCommandFactory.Factory().Create(controller) as ChangeOntologyEquivalentCommand;

            command.Element      = element;
            command.NewOntoEquiv = newOntoEquiv;
            command.Execute();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates controller for a diagram
 /// </summary>
 public DiagramController(Diagram diagram, ModelController modelController)
 {
     Diagram         = diagram;
     ModelController = modelController;
 }