public SessionVisual(ElementSpace space, TheoryTree tree, Session session) { mod = Session.Mods.Basic; InitializeComponent(); canvas = space; this.tree = tree; this.session = session; space.ElementsFocused += new Protsenko.TheoryEditor.Core.Events.Focused(space_ElementFocused); Grid.SetColumn(canvas, 0); Grid.SetColumnSpan(canvas,2); maingrid.Children.Add(canvas); Updated += new Protsenko.TheoryEditor.Core.Events.Updated(SessionVisual_Updated); }
public Session(UIElement parent, string name, ConstructorMods mod) { Name = name; if (mod == ConstructorMods.New) { tree = new TheoryTree(); } else if (mod == ConstructorMods.Load) { try { Microsoft.Win32.OpenFileDialog filedialog = new Microsoft.Win32.OpenFileDialog(); filedialog.InitialDirectory = SaveLoad.currentFoldierPath; filedialog.DefaultExt = SaveLoad.fileExtension; filedialog.ShowDialog(); object loadedObject = null; SaveLoad.LoadData(filedialog.SafeFileName, out loadedObject); tree = (TheoryTree)loadedObject; } catch (Exception e) { exceptionHandler.Add(e); tree = new TheoryTree(); } } treeController = new TheoryTreeController(tree); elementspace = new ElementSpace(tree, treeController, this); visualRepresentation = new SessionVisual(elementspace,tree,this); if (parent is DockPanel) { DockPanel panel = (DockPanel)parent; panel.Children.Add(visualRepresentation); } elementspace = visualRepresentation.GetElementSpace(); }
public Arrows(ElementSpace space) { this.space = space; path = new Path(); }
private void obj_Focused(ElementSpace.TheoryVisualDecorator decorator) { }
private void obj_DragStart(ElementSpace.TheoryVisualDecorator element, MouseButtonEventArgs e) { isDragging = true; lastx = e.GetPosition(this).X; lasty = e.GetPosition(this).Y; currentDraggingObject = element; e.Handled = true; }
private void obj_DragEnd(ElementSpace.TheoryVisualDecorator element, MouseButtonEventArgs e) { isDragging = false; }