예제 #1
0
 public void AddNewContextMenu()
 {
     SelectedContextMenu       = new Class.ContextMenu();
     SelectedContextMenu.IsNew = true;
     //if (SelectedApplication.ContextMenuCollection == null) SelectedApplication.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>();
     //SelectedApplication.ContextMenuCollection.Add(SelectedContextMenu);
 }
예제 #2
0
        public void OkButton_Clicked()
        {
            if (EditContextMenuVisibility == Visibility.Visible)
            {
                if (SelectedContextMenu.Name == null)
                {
                    EditedItem.CombinedContextMenuCollection.Remove(SelectedContextMenu);
                }

                SetViewVisibility(true);
            }
            else if (EditAssociatedVisibility == Visibility.Visible)
            {
                if (!EditedItem.Associations.Contains(SelectedAssociation))
                {
                    // Add new association to the EditedItem's association collection
                    EditedItem.Associations.Add(SelectedAssociation);
                }

                SetViewVisibility(true);
            }
            else if (SelectExistingAssociationVisibility == Visibility.Visible)
            {
                if (SelectedExistingAssociation != null)
                {
                    SelectedAssociation = new Association();
                    SelectedAssociation.Setup(EditedItem.Name, SelectedExistingAssociation.Name);

                    foreach (var parameter in SelectedExistingAssociation.Parameters)
                    {
                        Parameter newParameter = new Parameter();
                        newParameter.Setup(parameter.Type, parameter.Value, parameter.Path);
                        SelectedAssociation.Parameters.Add(newParameter);
                    }

                    foreach (var cm in SelectedExistingAssociation.ContextMenuCollection)
                    {
                        Class.ContextMenu newContextMenu = new Class.ContextMenu();
                        newContextMenu.Setup(cm.Type, cm.Value, cm.Name);
                        SelectedAssociation.AddContextMenu(cm);
                    }
                }

                SetViewVisibility(showEditAssociation: true);
            }
            else
            {
                SelectedItem.Name = EditedItem.Name;
                SelectedItem.CombinedContextMenuCollection = EditedItem.CombinedContextMenuCollection;
                SelectedItem.Applications = editedItem.Applications;
                SelectedItem.Associations = EditedItem.Associations;
                SelectedItem.MiscText     = EditedItem.MiscText;
                Messenger.Default.Send <Message.M_EditTile>(new Message.M_EditTile(SelectedItem, this));
            }

            //proj.Execute(EditedItem);
            //Messenger.Default.Send<Message.M_SimpleAction>(new Message.M_SimpleAction(Message.M_SimpleAction.Action.RefreshViews));
        }
예제 #3
0
 public void AddNewContextMenu()
 {
     SelectedContextMenu = new Class.ContextMenu();
     if (EditedItem.CombinedContextMenuCollection == null)
     {
         EditedItem.CombinedContextMenuCollection = new ObservableCollection <Class.ContextMenu>();
     }
     EditedItem.CombinedContextMenuCollection.Add(SelectedContextMenu);
 }
예제 #4
0
        private void muProject_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi = (MenuItem)sender;

            //TODO The binding is not working correctly here; I'm not sure why. For some reason the
            //     The ContextMenu class is bound to the header property of the MenuItem.
            Class.ContextMenu contextMenu = (Class.ContextMenu)mi.Header;

            Utilities.OpenFolder(contextMenu.Value);
        }
예제 #5
0
        public void AddNewAssociationContextMenu()
        {
            Class.ContextMenu cm = new Class.ContextMenu();
            cm.Setup(Class.ContextMenu.ContextMenuTypeEnum.PATH, "", "");

            if (SelectedAssociation.ContextMenuCollection == null)
            {
                SelectedAssociation.ContextMenuCollection = new ObservableCollection <Class.ContextMenu>();
            }
            SelectedAssociation.ContextMenuCollection.Add(cm);
        }
예제 #6
0
        private void ChangeListViewItem_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            Class.ContextMenu cm = b.DataContext as Class.ContextMenu;

            if (cm != null)
            {
                switch (b.Tag.ToString())
                {
                case "Edit":
                    vm.SelectedContextMenu = cm;
                    break;

                case "Delete":
                    vm.DeleteContextMenu(cm);
                    break;

                default:
                    break;
                }
            }
            else
            {
                Class.Association association = b.DataContext as Class.Association;

                if (association != null)
                {
                    switch (b.Tag.ToString())
                    {
                    case "Edit":
                        //vm.SelectedAssociation = association;
                        vm.EditAssociation(false, association);
                        break;

                    case "Delete":
                        vm.DeleteAssociation(association);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
예제 #7
0
        private void ChangeListViewItem_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            Class.ContextMenu cm = b.DataContext as Class.ContextMenu;

            if (cm != null)
            {
                switch (b.Tag.ToString())
                {
                case "Edit":
                    VM.SelectedContextMenu = cm;
                    break;

                case "Delete":
                    VM.DeleteContextMenu(cm);
                    break;

                default:
                    break;
                }
            }
        }
예제 #8
0
        public void OkButton_Clicked()
        {
            if (EditContextMenuVisibility == Visibility.Visible)
            {
                if (SelectedContextMenu.Name == null)
                {
                    EditedItem.ContextMenuCollection.Remove(SelectedContextMenu);
                }

                SetViewVisibility(true);
            }
            else if (EditAssociatedVisibility == Visibility.Visible)
            {
                if (!EditedItem.Associations.Contains(SelectedAssociation))
                {
                    // Add new association to the EditedItem's association collection
                    EditedItem.Associations.Add(SelectedAssociation);
                }

                SetViewVisibility(true);
            }
            else if (SelectExistingAssociationVisibility == Visibility.Visible)
            {
                if (SelectedExistingAssociation != null)
                {
                    SelectedAssociation = new Association();
                    SelectedAssociation.Setup(EditedItem.Name, SelectedExistingAssociation.Name);

                    foreach (var parameter in SelectedExistingAssociation.Parameters)
                    {
                        Parameter newParameter = new Parameter();
                        newParameter.Setup(parameter.Type, parameter.Value, parameter.Path);
                        SelectedAssociation.Parameters.Add(newParameter);
                    }

                    foreach (var cm in SelectedExistingAssociation.ContextMenuCollection)
                    {
                        Class.ContextMenu newContextMenu = new Class.ContextMenu();
                        newContextMenu.Setup(cm.Type, cm.Value, cm.Name);
                        SelectedAssociation.AddContextMenu(cm);
                    }
                }

                SetViewVisibility(showEditAssociation:true);
            }
            else
            {
                SelectedItem.Name = EditedItem.Name;
                SelectedItem.ContextMenuCollection = EditedItem.ContextMenuCollection;
                SelectedItem.Applications = editedItem.Applications;
                SelectedItem.Associations = EditedItem.Associations;
                SelectedItem.MiscText = EditedItem.MiscText;
                Messenger.Default.Send<Message.M_EditTile>(new Message.M_EditTile(SelectedItem, this));
            }

            //proj.Execute(EditedItem);
            //Messenger.Default.Send<Message.M_SimpleAction>(new Message.M_SimpleAction(Message.M_SimpleAction.Action.RefreshViews));
        }
예제 #9
0
 public void AddNewContextMenu()
 {
     SelectedContextMenu = new Class.ContextMenu();
     if (EditedItem.ContextMenuCollection == null) EditedItem.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>();
     EditedItem.ContextMenuCollection.Add(SelectedContextMenu);
 }
예제 #10
0
        public void AddNewAssociationContextMenu()
        {
            Class.ContextMenu cm = new Class.ContextMenu();
            cm.Setup(Class.ContextMenu.ContextMenuTypeEnum.PATH, "", "");

            if (SelectedAssociation.ContextMenuCollection == null) SelectedAssociation.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>();
            SelectedAssociation.ContextMenuCollection.Add(cm);
        }
예제 #11
0
 public void AddNewContextMenu()
 {
     SelectedContextMenu = new Class.ContextMenu();
     SelectedContextMenu.IsNew = true;
     //if (SelectedApplication.ContextMenuCollection == null) SelectedApplication.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>();
     //SelectedApplication.ContextMenuCollection.Add(SelectedContextMenu);
 }
예제 #12
0
 public void DeleteContextMenu(Class.ContextMenu cm)
 {
     EditedItem.CombinedContextMenuCollection.Remove(cm);
 }
예제 #13
0
 public void DeleteContextMenu(Class.ContextMenu cm)
 {
     SelectedApplication.ContextMenuCollection.Remove(cm);
 }