Beispiel #1
0
        public void RemoveAttribute(Property attribute)
        {
            RemoveAttributeMacroCommand removeAttributeCommand = (RemoveAttributeMacroCommand)RemoveAttributeMacroCommandFactory.Factory().Create(DiagramController.ModelController);

            removeAttributeCommand.Set(attribute);
            removeAttributeCommand.AssociatedElements.Add(Class);
            if (removeAttributeCommand.Commands.Count > 0)
            {
                removeAttributeCommand.Execute();
            }
        }
Beispiel #2
0
        private void OnAttributeRemoveClick(object sender, RoutedEventArgs e)
        {
            MenuItem m = sender as MenuItem;

            if (m.DataContext is Property)
            {
                RemoveAttributeMacroCommand removeAttributeCommand = (RemoveAttributeMacroCommand)RemoveAttributeMacroCommandFactory.Factory().Create(project.GetModelController());
                removeAttributeCommand.Set(m.DataContext as Property);
                if (removeAttributeCommand.Commands.Count > 0)
                {
                    removeAttributeCommand.Execute();
                }
            }
        }