//SELECTION private void OpenSelectionContextMenu(FrameworkElement theShape) { int i = (int)theShape.GetValue(ModuleView.AreaNumberProperty); Rectangle r = theSelection.selectedRectangles[i].GetRectangle(dp); theShape.ContextMenu = new ContextMenu(); SelectionView.CreateSelectionContextMenu(i, theShape.ContextMenu); theShape.ContextMenu.IsOpen = true; }
public static void InsertModule(int currentNeuron) { if (labelCursor == null) { return; } //TODO check to see if the underlying area is empty and warn if not MainWindow.theNeuronArray.SetUndoPoint(); MainWindow.theNeuronArray.AddModuleUndo(MainWindow.theNeuronArray.modules.Count, null); string moduleName = labelCursor.Content.ToString(); SelectionView.CreateModule(moduleName, "Module" + moduleName, Colors.LightBlue, currentNeuron, 0, 0); StopInsertingModule(); MainWindow.Update(); MainWindow.arrayView.currentOperation = CurrentOperation.idle; }