コード例 #1
0
        public ShellViewModel(
            CommandService commandService,
            Lazy <StatusBarViewModel> statusBar,
            MainMenuService mainMenuService,
            ToolbarService toolbarService,
            [ImportMany] IEnumerable <Lazy <IExtension> > extensions,
            [ImportMany] IEnumerable <Lazy <ToolViewModel> > toolControls)
        {
            _extensions   = extensions;
            _toolControls = toolControls;

            _commandService = commandService;

            MainMenu = mainMenuService.GetMainMenu();

            var toolbars = toolbarService.GetToolbars();

            StandardToolbar = toolbars.Single(t => t.Key == "Standard").Value;

            _statusBar = statusBar;

            _keyBindings = new List <KeyBinding>();

            ModalDialog = new ModalDialogViewModelBase("Dialog");

            _documents = new List <IDocumentTabViewModel>();
        }
コード例 #2
0
        public ErrorListPad()
        {
            instance   = this;
            properties = PropertyService.Get("ErrorListPad", new Properties());

            RedrawContent();

            TaskService.Cleared         += new EventHandler(TaskServiceCleared);
            TaskService.Added           += new TaskEventHandler(TaskServiceAdded);
            TaskService.Removed         += new TaskEventHandler(TaskServiceRemoved);
            TaskService.InUpdateChanged += delegate {
                if (!TaskService.InUpdate)
                {
                    InternalShowResults();
                }
            };

            ProjectService.EndBuild       += ProjectServiceEndBuild;
            ProjectService.SolutionLoaded += OnSolutionOpen;
            ProjectService.SolutionClosed += OnSolutionClosed;

            taskView.CreateControl();
            contentPanel.Controls.Add(taskView);

            toolStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ErrorList/Toolbar");
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            contentPanel.Controls.Add(toolStrip);

            InternalShowResults();
        }
コード例 #3
0
        public ClassBrowserPad()
        {
            instance = this;
            classBrowserTreeView.Dock         = DockStyle.Fill;
            classBrowserTreeView.ImageList    = ClassBrowserIconService.ImageList;
            classBrowserTreeView.AfterSelect += new TreeViewEventHandler(ClassBrowserTreeViewAfterSelect);

            contentPanel.Controls.Add(classBrowserTreeView);

            searchStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ClassBrowser/Searchbar");
            searchStrip.Stretch   = true;
            searchStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            contentPanel.Controls.Add(searchStrip);

            toolStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ClassBrowser/Toolbar");
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            contentPanel.Controls.Add(toolStrip);

            ProjectService.SolutionLoaded        += ProjectServiceSolutionChanged;
            ProjectService.ProjectItemAdded      += ProjectServiceSolutionChanged;
            ProjectService.ProjectItemRemoved    += ProjectServiceSolutionChanged;
            ProjectService.ProjectAdded          += ProjectServiceSolutionChanged;    // rebuild view when project is added to solution
            ProjectService.SolutionFolderRemoved += ProjectServiceSolutionChanged;    // rebuild view when project is removed from solution
            ProjectService.SolutionClosed        += ProjectServiceSolutionClosed;

            ParserService.ParseInformationUpdated += new ParseInformationEventHandler(ParserServiceParseInformationUpdated);

            AmbienceService.AmbienceChanged += new EventHandler(AmbienceServiceAmbienceChanged);
            if (ProjectService.OpenSolution != null)
            {
                ProjectServiceSolutionChanged(null, null);
            }
            UpdateToolbars();
        }
コード例 #4
0
        public HtmlViewPane(bool showNavigation)
        {
            Dock = DockStyle.Fill;
            Size = new Size(500, 500);

            webBrowser                    = new ExtendedWebBrowser();
            webBrowser.Dock               = DockStyle.Fill;
            webBrowser.Navigating        += WebBrowserNavigating;
            webBrowser.NewWindowExtended += NewWindow;
            webBrowser.Navigated         += WebBrowserNavigated;
            webBrowser.StatusTextChanged += WebBrowserStatusTextChanged;
            webBrowser.DocumentCompleted += WebBrowserDocumentCompleted;
            PictureBox pictureBox = new PictureBox();

            //pictureBox.Dock = DockStyle.Right;
            pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox.Size     = new Size(400, 300);
            int x = SystemInformation.WorkingArea.Width - pictureBox.Size.Width - 200;
            int y = SystemInformation.WorkingArea.Height - pictureBox.Size.Height - 40;

            pictureBox.Location = new Point(x, y);
            Assembly assm = Assembly.GetExecutingAssembly();

            System.IO.Stream istr = assm.GetManifestResourceStream("FanHai.Gui.Framework.Resources.home.jpg");
            pictureBox.Image = Image.FromStream(istr);

            Controls.Add(pictureBox);

            if (showNavigation)
            {
                toolStrip           = ToolbarService.CreateToolStrip(this, "/FanHaiFramework/ViewContent/Browser/Toolbar");
                toolStrip.GripStyle = ToolStripGripStyle.Hidden;
                Controls.Add(toolStrip);
            }
        }
コード例 #5
0
        void InitializeToolStrip()
        {
            taskView.CreateControl();

            contentPanel.Controls.Add(taskView);

            string[] tokens = PropertyService.Get <string[]>("SharpDevelop.TaskListTokens", ParserService.DefaultTaskListTokens);

            foreach (string token in tokens)
            {
                if (!this.displayedTokens.ContainsKey(token))
                {
                    this.displayedTokens.Add(token, true);
                }
            }

            toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/TaskList/Toolbar");
            ShowTaskListTokenButton[] buttons = TaskListTokensBuilder.BuildItems(tokens);

            foreach (ShowTaskListTokenButton button in buttons)
            {
                toolStrip.Items.Add(new ToolBarSeparator());
                toolStrip.Items.Add((ToolStripItem)button.Owner);
            }

            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            contentPanel.Controls.Add(toolStrip);
        }
コード例 #6
0
 void CreateToolBars()
 {
     if (ToolBars == null)
     {
         ToolBars = ToolbarService.CreateToolbars(this, "/SharpDevelop/Workbench/ToolBar");
     }
 }
コード例 #7
0
 void ToolStripVisibleChanged(object sender, EventArgs e)
 {
     if (this.toolStrip.Visible)
     {
         this.toolStrip.VisibleChanged -= this.ToolStripVisibleChanged;
         ToolbarService.UpdateToolbar(this.toolStrip);
     }
 }
コード例 #8
0
 public StatisticControl()
 {
     InitializeComponent();
     _toolStrip           = ToolbarService.CreateToolStrip(this, "/FrameWork/PlotToolStrip");
     _toolStrip.GripStyle = ToolStripGripStyle.Hidden;
     _toolStrip.Dock      = DockStyle.Right;
     Controls.Add(_toolStrip);
 }
コード例 #9
0
        protected virtual ToolStrip CreateToolStrip()
        {
            ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/BookmarkPad/Toolbar");

            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            return(toolStrip);
        }
コード例 #10
0
ファイル: ObjectExplorer.cs プロジェクト: beritec/fdotoolbox
        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectExplorer"/> class.
        /// </summary>
        public ObjectExplorer()
        {
            imgList = new ImageList();
            InitTreeView();
            objToolStrip = ToolbarService.CreateToolStrip(this, "/ObjectExplorer/Toolbar");

            this.Controls.Add(objTreeView);
            this.Controls.Add(objToolStrip);
        }
コード例 #11
0
ファイル: Workbench.cs プロジェクト: morkl/fdotoolbox
        private Workbench()
        {
            InitializeComponent();

            _toolstrips       = new Dictionary <string, ToolStrip>();
            _toolstripRegions = new Dictionary <string, ToolbarRegion>();

            this.Icon = ResourceService.GetIcon("FdoToolbox");

            contentPanel = new DockPanel();
            contentPanel.DocumentStyle     = DocumentStyle.DockingWindow;
            contentPanel.Dock              = DockStyle.Fill;
            contentPanel.DockLeftPortion   = 200;
            contentPanel.DockBottomPortion = 150;
            contentPanel.DockRightPortion  = 200;

            menu = new MenuStrip();
            MenuService.AddItemsToMenu(menu.Items, this, "/Workbench/MainMenu");

            toolStripContainer = new ToolStripContainer();
            toolStripContainer.ContentPanel.Controls.Add(contentPanel);
            toolStripContainer.Dock = DockStyle.Fill;

            this.Controls.Add(toolStripContainer);

            ctxToolbar = new ContextMenuStrip();
            toolStripContainer.TopToolStripPanel.ContextMenuStrip    = ctxToolbar;
            toolStripContainer.BottomToolStripPanel.ContextMenuStrip = ctxToolbar;
            toolStripContainer.LeftToolStripPanel.ContextMenuStrip   = ctxToolbar;
            toolStripContainer.RightToolStripPanel.ContextMenuStrip  = ctxToolbar;

            toolbar = ToolbarService.CreateToolStrip(this, "/Workbench/Toolbar");
            AddToolbar("Base", toolbar, ToolbarRegion.Top, false);

            status      = new StatusStrip();
            statusLabel = new ToolStripStatusLabel();
            status.Items.Add(statusLabel);

            this.Controls.Add(menu);
            this.Controls.Add(status);

            //this.IsMdiContainer = true;

            ObjectExplorer exp = new ObjectExplorer();

            objExplorer = exp;

            ConsolePane console = new ConsolePane();

            appConsole = console;

            ShowContent(console, ViewRegion.Bottom);
            ShowContent(exp, ViewRegion.Left);

            // Use the Idle event to update the status of menu and toolbar items.
            Application.Idle += OnApplicationIdle;
        }
コード例 #12
0
        public JsonResult GetToolbarButtonListByActionCode(string actionCode, string entityId, string parentEntityId, bool?boundToExternal)
        {
            int.TryParse(entityId, out var parsedId);
            int.TryParse(parentEntityId, out var parsedParentId);

            var buttonsList = ToolbarService.GetButtonListByActionCode(actionCode, parsedId, parsedParentId, boundToExternal);

            return(Json(buttonsList));
        }
コード例 #13
0
 void UpdateToolbars()
 {
     if (ToolBars != null)
     {
         foreach (ToolStrip toolStrip in ToolBars)
         {
             ToolbarService.UpdateToolbar(toolStrip);
         }
     }
 }
コード例 #14
0
 void RemoveSpecialPanel()
 {
     if (specialPanel != null)
     {
         specialPanel = null;
         myPanel.Controls.Remove(specialPanel);
         myPanel.Controls.Add(resultTreeView);
         myPanel.Controls.SetChildIndex(resultTreeView, 0);
         ToolbarService.UpdateToolbar(toolStrip);
     }
 }
コード例 #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextEditor"/> class.
        /// </summary>
        public TextEditor()
        {
            InitializeComponent();

            toolstrip   = ToolbarService.CreateToolStrip(this, "/FdoToolbox/TextEditor/Toolbar");
            editor      = new TextEditorControl();
            editor.Dock = DockStyle.Fill;

            this.Controls.Add(editor);
            this.Controls.Add(toolstrip);
        }
コード例 #16
0
 void UpdateToolStrip(AbstractProjectBrowserTreeNode node)
 {
     toolStrip.Items.Clear();
     toolStrip.Items.AddRange(standardItems);
     ToolbarService.UpdateToolbar(toolStrip);
     if (node != null && node.ToolbarAddinTreePath != null)
     {
         toolStrip.Items.Add(new ToolStripSeparator());
         toolStrip.Items.AddRange((ToolStripItem[])AddInTree.BuildItems(node.ToolbarAddinTreePath, node, false).ToArray(typeof(ToolStripItem)));
     }
 }
コード例 #17
0
        void CreateToolBars()
        {
            if (ToolBars == null)
            {
#if ModifiedForAltaxo
                ToolBars = ToolbarService.CreateToolbars(this, toolBarPath);
#else
                ToolBars = ToolbarService.CreateToolbars(this, "/SharpDevelop/Workbench/ToolBar");
#endif
            }
        }
コード例 #18
0
        public ClassDiagramViewContent(OpenedFile file) : base(file)
        {
            this.TabPageText = "Class Diagram";

            canvas.LayoutChanged += HandleLayoutChange;
            ParserService.ParseInformationUpdated += OnParseInformationUpdated;
            toolstrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/ViewContent/ClassDiagram/Toolbar");
            toolstrip.GripStyle = ToolStripGripStyle.Hidden;
            toolstrip.Stretch   = true;
            canvas.Controls.Add(toolstrip);
            canvas.ContextMenuStrip = MenuService.CreateContextMenu(this, "/SharpDevelop/ViewContent/ClassDiagram/ContextMenu");
        }
コード例 #19
0
 /// <summary>
 /// Changes wordwrap settings if that property has changed.
 /// </summary>
 void PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.Key == "WordWrap")
     {
         SetWordWrap();
         ToolbarService.UpdateToolbar(toolStrip);
     }
     if (e.Key == "DefaultFont")
     {
         textEditorControl.Font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());
     }
 }
コード例 #20
0
        public SearchResultPanel()
        {
            instance = this;

            resultTreeView.Dock     = DockStyle.Fill;
            resultTreeView.Font     = ExtTreeNode.RegularBigFont;
            resultTreeView.IsSorted = false;
            toolStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/SearchResultPanel/Toolbar");
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            myPanel.Controls.AddRange(new Control[] { resultTreeView, toolStrip });
        }
コード例 #21
0
ファイル: Workbench1.cs プロジェクト: carlhuth/GenXSource
        // this method simply copies over the enabled state of the toolbar,
        // this assumes that no item is inserted or removed.
        // TODO : make this method more add-in tree like, currently with Windows.Forms
        //        toolbars this is not possible. (drawing fragments, slow etc.)
        void CreateToolBars()
        {
            if (ToolBars == null)
            {
#if OriginalSharpDevelopCode
                ToolbarService toolBarService = (ToolbarService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(ToolbarService));
#else
                // Note: original ToolbarService don't support checked toolbar items
                AltaxoToolbarService toolBarService = (AltaxoToolbarService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(AltaxoToolbarService));
#endif
                CommandBar[] toolBars = toolBarService.CreateToolbars();
                ToolBars = toolBars;
            }
        }
コード例 #22
0
        public MapStatistics()
        {
            InitializeComponent();
            _XAxis.AxislineStyle = OxyPlot.LineStyle.Solid;
            _YAxis.AxislineStyle = OxyPlot.LineStyle.Solid;
            _CAxis.AxislineStyle = OxyPlot.LineStyle.Solid;

            //为界面右侧增加一个工具条控件
            _toolStrip           = ToolbarService.CreateToolStrip(this, "/FrameWork/ToolStrips/StatisticPlot");
            _toolStrip.GripStyle = ToolStripGripStyle.Hidden;
            _toolStrip.Dock      = DockStyle.Right;
            Controls.Add(_toolStrip);
            //plotView1.Model = _pm;
        }
コード例 #23
0
ファイル: ConsolePane.cs プロジェクト: beritec/fdotoolbox
        public ConsolePane()
        {
            inputBox        = new TextBox();
            txtConsole      = new RichTextBox();
            txtConsole.Font = new Font(FontFamily.GenericMonospace, 8.0f);
            toolStrip1      = ToolbarService.CreateToolStrip(this, "/AppConsole/Toolbar");

            txtConsole.Dock = DockStyle.Fill;
            inputBox.Dock   = DockStyle.Bottom;

            this.Controls.Add(txtConsole);
            this.Controls.Add(inputBox);
            this.Controls.Add(toolStrip1);
        }
コード例 #24
0
 void UpdateToolStrip(AbstractProjectBrowserTreeNode node)
 {
     if (toolStrip == null)
     {
         return;
     }
     toolStrip.Items.Clear();
     toolStrip.Items.AddRange(standardItems);
     ToolbarService.UpdateToolbar(toolStrip);
     if (node != null && node.ToolbarAddinTreePath != null)
     {
         toolStrip.Items.Add(new ToolStripSeparator());
         toolStrip.Items.AddRange(ToolbarService.CreateToolStripItems(node.ToolbarAddinTreePath, node, false));
     }
 }
コード例 #25
0
        public ErrorListPad()
        {
            instance   = this;
            properties = PropertyService.Get("ErrorListPad", new Core.Properties());

            RedrawContent();


            toolStrip           = ToolbarService.CreateToolStrip(this, "/FanHaiFramework/Pads/ErrorList/Toolbar");
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            contentPanel.Controls.Add(toolStrip);

            InternalShowResults();
        }
コード例 #26
0
        public ProjectBrowserPanel()
        {
            projectBrowserControl      = new ProjectBrowserControl();
            projectBrowserControl.Dock = DockStyle.Fill;
            Controls.Add(projectBrowserControl);

            toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard");
            toolStrip.ShowItemToolTips = true;
            toolStrip.Dock             = DockStyle.Top;
            toolStrip.GripStyle        = System.Windows.Forms.ToolStripGripStyle.Hidden;
            toolStrip.Stretch          = true;
            standardItems = new ToolStripItem[toolStrip.Items.Count];
            toolStrip.Items.CopyTo(standardItems, 0);
            Controls.Add(toolStrip);
            projectBrowserControl.TreeView.BeforeSelect += TreeViewBeforeSelect;
        }
コード例 #27
0
        public NAntPadContent()
        {
            LoggingService.Debug("NAntPadContent.ctor");
            // Create main panel.
            contentPanel = new Panel();

            // Initialise treeview.
            treeView      = new NAntPadTreeView();
            treeView.Dock = DockStyle.Fill;

            // Create ToolStrip.
            toolStrip           = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/NAntPad/Toolbar");
            toolStrip.GripStyle = ToolStripGripStyle.Hidden;

            // Create text box.
            textBox          = new TextBox();
            textBox.WordWrap = false;
            textBox.Dock     = DockStyle.Bottom;

            // Tooltip.
            ToolTip toolTip = new ToolTip();

            toolTip.SetToolTip(textBox, StringParser.Parse("Enter NAnt properties."));

            contentPanel.Controls.Add(treeView);
            contentPanel.Controls.Add(toolStrip);
            contentPanel.Controls.Add(textBox);

            ProjectService.SolutionLoaded     += SolutionLoaded;
            ProjectService.SolutionClosed     += SolutionClosed;
            ProjectService.ProjectItemRemoved += ProjectItemRemoved;
            ProjectService.ProjectItemAdded   += ProjectItemAdded;
            SD.Workbench.ViewOpened           += WorkbenchViewOpened;
            SD.Workbench.ViewClosed           += WorkbenchViewClosed;
            FileService.FileRenamed           += FileRenamed;
            FileService.FileRemoved           += FileRemoved;
            FileUtility.FileSaved             += FileSaved;

            NAntRunnerSingleton.Runner.NAntStarted += NAntStarted;
            NAntRunnerSingleton.Runner.NAntStopped += NAntStopped;
            NAntRunnerSingleton.Runner.NAntExited  += NAntExited;

            // Due to lazy loading we have missed the solution loaded event
            // so add it now.
            Refresh();
        }
コード例 #28
0
        void CreateToolBars()
        {
            ToolbarService toolBarService = (ToolbarService)ServiceManager.Services.GetService(typeof(ToolbarService));

            ToolBars = null;

            ToolBars = toolBarService.CreateToolbars();

            foreach (Bar toolBar in ToolBars)
            {
                if (dotNetBarManager1.Bars.Contains(toolBar) == false)
                {
                    dotNetBarManager1.Bars.Add(toolBar);
                }
                toolBar.DockSide = eDockSide.Top;
            }
        }
コード例 #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UnusedResourceKeysViewContent"/> class.
        /// </summary>
        /// <param name="unusedKeys">A collection of <see cref="ResourceItem"/> classes that represent the unused resource keys to display.</param>
        public UnusedResourceKeysViewContent(ICollection <ResourceItem> unusedKeys)
        {
            LoggingService.Debug("ResourceToolkit: Creating new UnusedResourceKeysViewContent");

            this.TitleName = StringParser.Parse("${res:Hornung.ResourceToolkit.UnusedResourceKeys.Title}");

            if (unusedKeys == null)
            {
                throw new ArgumentNullException("unusedKeys");
            }
            this.unusedKeys = unusedKeys;

            this.panel = new Panel();
            this.panel.SuspendLayout();
            this.panel.Dock = DockStyle.Fill;

            this.listView = new ListView();
            this.ListView.Columns.Add(StringParser.Parse("${res:Global.FileName}"), 60);
            this.ListView.Columns.Add(StringParser.Parse("${res:Hornung.ResourceToolkit.Key}"), 140);
            this.ListView.Columns.Add(StringParser.Parse("${res:Hornung.ResourceToolkit.Value}"), 140);
            this.ListView.View               = View.Details;
            this.ListView.FullRowSelect      = true;
            this.ListView.ShowItemToolTips   = true;
            this.ListView.ListViewItemSorter = new ResourceListViewItemComparer();
            this.ListView.Dock               = DockStyle.Fill;
            this.ListView.Resize            += delegate {
                if (this.ListView != null && !this.ListView.IsDisposed && !this.ListView.Disposing && this.ListView.Columns.Count >= 3)
                {
                    this.ListView.Columns[0].Width = Convert.ToInt32(this.ListView.Width * 0.20);
                    this.ListView.Columns[1].Width = Convert.ToInt32(this.ListView.Width * 0.45);
                    this.ListView.Columns[2].Width = Convert.ToInt32(this.ListView.Width * 0.30);
                }
            };
            this.ListView.HandleCreated   += this.ListViewHandleCreated;
            this.ListView.ContextMenuStrip = MenuService.CreateContextMenu(this, "/AddIns/ResourceToolkit/ViewContent/UnusedResourceKeys/ListViewContextMenu");

            this.toolStrip                 = ToolbarService.CreateToolStrip(this, "/AddIns/ResourceToolkit/ViewContent/UnusedResourceKeys/Toolbar");
            this.toolStrip.Dock            = DockStyle.Top;
            this.toolStrip.Stretch         = true;
            this.toolStrip.VisibleChanged += this.ToolStripVisibleChanged;

            this.panel.Controls.Add(this.ListView);
            this.panel.Controls.Add(toolStrip);
            this.panel.ResumeLayout();
        }
コード例 #30
0
        public Toolbar(IToolbarService toolbarService)
        {
            InitializeComponent();

            _toolbarService = toolbarService as ToolbarService;

            // Update toolbar if service changed.
            _toolbarService.PropertyChanged += (s, e) =>
            {
                if (_toolbarService.Children.Count > 0)
                {
                    Application.Current.Dispatcher.Invoke(() => RefreshToolbar());
                }
            };

            // Inital refresh
            RefreshToolbar();
        }