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>(); }
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(); }
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(); }
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); } }
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); }
void CreateToolBars() { if (ToolBars == null) { ToolBars = ToolbarService.CreateToolbars(this, "/SharpDevelop/Workbench/ToolBar"); } }
void ToolStripVisibleChanged(object sender, EventArgs e) { if (this.toolStrip.Visible) { this.toolStrip.VisibleChanged -= this.ToolStripVisibleChanged; ToolbarService.UpdateToolbar(this.toolStrip); } }
public StatisticControl() { InitializeComponent(); _toolStrip = ToolbarService.CreateToolStrip(this, "/FrameWork/PlotToolStrip"); _toolStrip.GripStyle = ToolStripGripStyle.Hidden; _toolStrip.Dock = DockStyle.Right; Controls.Add(_toolStrip); }
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); }
/// <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); }
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; }
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)); }
void UpdateToolbars() { if (ToolBars != null) { foreach (ToolStrip toolStrip in ToolBars) { ToolbarService.UpdateToolbar(toolStrip); } } }
void RemoveSpecialPanel() { if (specialPanel != null) { specialPanel = null; myPanel.Controls.Remove(specialPanel); myPanel.Controls.Add(resultTreeView); myPanel.Controls.SetChildIndex(resultTreeView, 0); ToolbarService.UpdateToolbar(toolStrip); } }
/// <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); }
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))); } }
void CreateToolBars() { if (ToolBars == null) { #if ModifiedForAltaxo ToolBars = ToolbarService.CreateToolbars(this, toolBarPath); #else ToolBars = ToolbarService.CreateToolbars(this, "/SharpDevelop/Workbench/ToolBar"); #endif } }
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"); }
/// <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()); } }
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 }); }
// 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; } }
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; }
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); }
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)); } }
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(); }
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; }
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(); }
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; } }
/// <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(); }
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(); }