public void AddNewContextMenu() { SelectedContextMenu = new Class.ContextMenu(); SelectedContextMenu.IsNew = true; //if (SelectedApplication.ContextMenuCollection == null) SelectedApplication.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>(); //SelectedApplication.ContextMenuCollection.Add(SelectedContextMenu); }
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)); }
public void AddNewContextMenu() { SelectedContextMenu = new Class.ContextMenu(); if (EditedItem.CombinedContextMenuCollection == null) { EditedItem.CombinedContextMenuCollection = new ObservableCollection <Class.ContextMenu>(); } EditedItem.CombinedContextMenuCollection.Add(SelectedContextMenu); }
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); }
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); }
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; } } } }
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; } } }
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)); }
public void AddNewContextMenu() { SelectedContextMenu = new Class.ContextMenu(); if (EditedItem.ContextMenuCollection == null) EditedItem.ContextMenuCollection = new ObservableCollection<Class.ContextMenu>(); EditedItem.ContextMenuCollection.Add(SelectedContextMenu); }
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); }
public void DeleteContextMenu(Class.ContextMenu cm) { EditedItem.CombinedContextMenuCollection.Remove(cm); }
public void DeleteContextMenu(Class.ContextMenu cm) { SelectedApplication.ContextMenuCollection.Remove(cm); }