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 TheoryImporterPanel(TheoryTree tree, Session session)
        {
            InitializeComponent();
            this.tree = tree;
            this.session = session;

            MenuItem item;
            foreach(TheoryTypes type in TheoryTypesClass.GetTypes())
            {
                item = new MenuItem();
                item.Name = type.ToString();
                item.Click += new RoutedEventHandler(item_Click);
                cm.Items.Add(item);
            }

            browser = new WebBrowser();

            LanguageResource.Updated +=new Protsenko.TheoryEditor.Core.Events.Updated(LanguageResource_Updated);
            LanguageResource_Updated("");
        }
        //***************************Element Space***************************************************************************************************************************************************************************
        public ElementSpace(TheoryTree tree, TheoryTreeController treeController, Session session)
        {
            InitializeComponent();
            allocator = new ElementAllocator(Children,this);
            //arrows = new Arrows(this);
            this.session = session;
            this.tree = tree;
            this.treeController = treeController;
            this.tree.ContentUpdated += new Protsenko.TheoryEditor.Core.Events.ContentUpdated(tree_ContentUpdated);
            focusedObjects = new List<TheoryVisualDecorator>();

            this.MouseRightButtonUp += new MouseButtonEventHandler(CanvasMy_MouseRightButtonUp);
            this.MouseLeftButtonDown += new MouseButtonEventHandler(dragpanel_MouseLeftButtonDown);
            this.MouseMove += new MouseEventHandler(dragpanel_MouseMove);
            this.MouseLeftButtonUp += new MouseButtonEventHandler(dragpanel_MouseLeftButtonUp);
            this.MouseLeave += new MouseEventHandler(CanvasMy_MouseLeave);
            this.MouseWheel += new MouseWheelEventHandler(CanvasMy_MouseWheel);
            this.LayoutUpdated += new EventHandler(ElementSpace_LayoutUpdated);     // not mvc //костыль
            this.ElementsFocused += new Protsenko.TheoryEditor.Core.Events.Focused(ElementSpace_ElementFocused);

            if (tree.Count != 0)
                tree.RunUpdateForeachElement();
        }
 public void ChangeMode(Session.Mods mod)
 {
     this.mod = mod;
     Updated(this);
 }