コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Session.cs プロジェクト: protsenkovi/Theory-Editor
        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();
        }
コード例 #3
0
 public Arrows(ElementSpace space)
 {
     this.space = space;
     path = new Path();
 }
コード例 #4
0
 private void obj_Focused(ElementSpace.TheoryVisualDecorator decorator)
 {
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 private void obj_DragEnd(ElementSpace.TheoryVisualDecorator element, MouseButtonEventArgs e)
 {
     isDragging = false;
 }