public WindowManager(DockPanel dockPanel)
        {
            this.dockPanel  = dockPanel;
            this.mruManager = new MRUManager(Env.Current.Commands.GetContext("FileContext"), this);

            //Create toolwindows
            projectContentView = new ProjectContentView(this);
            projectContentView.Show(dockPanel, DockState.DockLeft);
            projectContentView.OpenEntity += new ProjectContentView.OpenEntityHandler(ActivateDocument);
            projectContentView.SelectNode += new ProjectContentView.SelectNodeHandler(OnSelectProjectNode);

            toolBoxView = new ToolBoxView();
            toolBoxView.Show(dockPanel, DockState.DockRight);

            propertyBrowserView = new PropertyBrowserView();
            propertyBrowserView.Show(toolBoxView.Pane, DockAlignment.Bottom, 0.6);

            //Connect Windows Manager to heleper events
            dockPanel.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            Env.Current.Commands.RegisterContext("ToolboxContext", new ToolboxContext(toolBoxView));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.LoadProjectCommand(mruManager, this));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new Commands.SaveProjectCommand(mruManager, this));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.NullCommand((int)CommandManager.Priorities.FileCommandsEnd));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.NullCommand((int)CommandManager.Priorities.MruCommandsEnd));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.ExitCommand());
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.NewProjectCommand(this));
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.NewSchemaCommand(this));
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.RunProjectCommand());

            //Env.Current.ScriptManager.NewScriptCreated += new ScriptManager.NewScriptCreatedHandler(OnOpenScript);
        }
Exemplo n.º 2
0
        public WindowManager(DockPanel dockPanel, MRUManager mruManager)
        {
            this.dockPanel  = dockPanel;
            this.mruManager = mruManager;

            mruManager.ItemClicked += new MRUManager.ItemClickedDelegate(OnMRUItemClicked);

            //Create toolwindows
            projectContentView = new ProjectContentView();
            projectContentView.Show(dockPanel, DockState.DockLeft);
            projectContentView.OpenEntity += new ProjectContentView.OpenEntityHandler(OnOpenProjectEntity);
            projectContentView.SelectNode += new ProjectContentView.SelectNodeHandler(OnSelectProjectNode);

            toolBoxView = new ToolBoxView();
            toolBoxView.Show(dockPanel, DockState.DockRight);

            propertyBrowserView = new PropertyBrowserView();
            propertyBrowserView.Show(toolBoxView.Pane, DockAlignment.Bottom, 0.6);

            //Connect Windows Manager to heleper events
            dockPanel.ActiveDocumentChanged            += new EventHandler(OnActiveDocumentChanged);
            CommandManager.toolboxContext               = new ToolboxContext(toolBoxView);
            Env.Current.ScriptManager.NewScriptCreated += new ScriptManager.NewScriptCreatedHandler(OnOpenScript);
        }