Exemple #1
0
        protected override void SetUpCore()
        {
            base.SetUpCore();

            ClearEventInfo();

            _workItem       = new TestableWorkItem();
            _commandService = new CommandService();
            _toolBarService = new ToolBarService(_workItem);

            _workItem.OnBuiltUp(null);

            //make sure the work item can adapt menus etc
            var commandAdapterMapService = _workItem.Services.Get <ICommandAdapterMapService>();

            commandAdapterMapService.Register(typeof(UIElement), typeof(UIElementCommandAdapter));

            var uiElementAdapterFactoryCatalog =
                _workItem.Services.Get <IUIElementAdapterFactoryCatalog>();

            uiElementAdapterFactoryCatalog.RegisterFactory(new ItemsControlUIAdapterFactory());
            uiElementAdapterFactoryCatalog.RegisterFactory(new ToolBarTrayUIAdapterFactory());

            //make sure the root tool bar tray exists and is registered in the work item
            _toolBarTray = new ToolBarTray();
            _workItem.UIExtensionSites.RegisterSite(ExtensionSites.ToolBar.Name, _toolBarTray);

            _toolBarService.ToolBarAdded += delegate(object sender, ToolBarEventArgs e) { _toolBarAddedEventArgs = e; };

            _toolBarService.ToolBarRemoved +=
                delegate(object sender, ToolBarEventArgs e) { _toolBarRemovedEventArgs = e; };

            _toolBarService.ToolBarVisibilityChanged +=
                delegate(object sender, ToolBarEventArgs e) { _toolBarVisibilityChangedEventArgs = e; };
        }
Exemple #2
0
        protected override ToolBar CreateToolBar()
        {
            ToolBar toolbar = ToolBarService.CreateToolBar(myPanel, this, "/SharpDevelop/Pads/BreakpointPad/Toolbar");

            toolbar.SetValue(Grid.RowProperty, 0);
            return(toolbar);
        }
Exemple #3
0
        public CompilerMessageView()
        {
            instance = this;

            AddCategory(TaskService.BuildMessageViewCategory);

            textEditor.IsReadOnly = true;

            textEditor.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/CompilerMessageView/ContextMenu");

            properties = (Properties)PropertyService.Get(OutputWindowOptionsPanel.OutputWindowsProperty, new Properties());

            var font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", Core.WinForms.WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());

            textEditor.FontFamily       = new FontFamily(font.FontFamily.Name);
            textEditor.FontSize         = Math.Round(font.Size * 96.0 / 72.0);
            properties.PropertyChanged += new PropertyChangedEventHandler(PropertyChanged);

            MessageViewLinkElementGenerator.RegisterGenerators(textEditor.TextArea.TextView);
            textEditor.TextArea.TextView.ElementGenerators.OfType <LinkElementGenerator>().ForEach(x => x.RequireControlModifierForClick = false);

            toolStrip = ToolBarService.CreateToolBar(panel, this, "/SharpDevelop/Pads/CompilerMessageView/Toolbar");
            toolStrip.SetValue(DockPanel.DockProperty, Dock.Top);

            panel.Children.Add(toolStrip);
            panel.Children.Add(textEditor);

            SetWordWrap();
            DisplayActiveCategory();
            ProjectService.SolutionLoaded += SolutionLoaded;

            textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new SearchInputHandler(textEditor.TextArea));
        }
        public ProjectBrowserPanel()
        {
            projectBrowserControl = new ProjectBrowserControl();
            projectBrowserControl.VerticalAlignment   = VerticalAlignment.Stretch;
            projectBrowserControl.HorizontalAlignment = HorizontalAlignment.Stretch;

            DockPanel.SetDock(projectBrowserControl, Dock.Bottom);
            //Controls.Add(projectBrowserControl);
            dockPanel = new DockPanel();
            dockPanel.LastChildFill = true;


            if (SD.AddInTree.GetTreeNode("/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard", false) != null)
            {
                toolStrip     = ToolBarService.CreateToolBar(this, this, "/SharpDevelop/Pads/ProjectBrowser/ToolBar/Standard");
                standardItems = new object[toolStrip.Items.Count];
                toolStrip.Items.CopyTo(standardItems, 0);
                toolStrip.Margin = new Thickness(0, 5, 0, 5);

                DockPanel.SetDock(toolStrip, Dock.Top);
                dockPanel.Children.Add(toolStrip);
                Style tbStyle = Application.Current.TryFindResource("MaterialDesignToolBar") as Style;
                if (tbStyle != null)
                {
                    toolStrip.Style = tbStyle;
                }
            }

            dockPanel.Children.Add(projectBrowserControl);
            this.Content = dockPanel;


            projectBrowserControl.TreeView.SelectedItemChanging += projectBrowserControl_TreeView_SelectedItemChanging;
        }
        public SearchResultsPad()
        {
            if (instance != null)
            {
                throw new InvalidOperationException("Cannot create multiple instances");
            }
            instance = this;
            toolBar  = new ToolBar();
            ToolBarTray.SetIsLocked(toolBar, true);
            defaultToolbarItems = ToolBarService.CreateToolBarItems(contentPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar");
            foreach (object toolBarItem in defaultToolbarItems)
            {
                toolBar.Items.Add(toolBarItem);
            }

            contentPlaceholder = new ContentPresenter();
            contentPanel       = new Grid {
                Children = { toolBar, contentPlaceholder }
            };

            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            Grid.SetRow(contentPlaceholder, 1);
        }
Exemple #6
0
 void UpdateMenu()
 {
     MenuService.UpdateStatus(mainMenu.ItemsSource);
     foreach (ToolBar tb in toolBars)
     {
         ToolBarService.UpdateStatus(tb.ItemsSource);
     }
 }
Exemple #7
0
 public MainWindow()
 {
     InitializeComponent();
     model       = SharedModel.GetInstance();
     toolBar     = ToolBarService.GetInstance();
     DataContext = this;
     NextShape(DrawShape.Line);
 }
 private void CreateToolBars(object sender, EventArgs e)
 {
     if (this.toolBars == null)
     {
         ToolBarService toolBarService = (ToolBarService)ServiceManager.Services.GetService(typeof(ToolBarService));
         ToolBarEx[]    toolBars       = toolBarService.CreateToolbars();
         this.toolBars = toolBars;
         this.Controls.AddRange(toolBars);
     }
 }
        private void CreateShowLayoutToolBarItem()
        {
            var showLayoutToolBarItem = ToolBarService.CreateToolBarButtonItem();

            showLayoutToolBarItem.DisplayName = "Layout";
            showLayoutToolBarItem.Command     = new DelegateCommand(() => Service.ShowLayoutAsync());
            showLayoutToolBarItem.IsVisible   = false;

            ToolBarService.Items.Add(showLayoutToolBarItem);
            this.SyncToolBarItemWithViewModelActivationState(showLayoutToolBarItem).AddDisposable(Disposables);
        }
Exemple #10
0
 /// <summary>
 /// Changes wordwrap settings if that property has changed.
 /// </summary>
 void PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == OutputWindowOptionsPanel.WordWrapName)
     {
         SetWordWrap();
         ToolBarService.UpdateStatus(toolStrip.Items);
     }
     if (IsFontChanged(e.PropertyName))
     {
         SetTextEditorFont();
     }
 }
        public BreakPointsPad()
        {
            var res = new CommonResources();

            res.InitializeComponent();

            Grid    grid    = (Grid)this.Control;
            ToolBar toolbar = ToolBarService.CreateToolBar(grid, this, "/SharpDevelop/Pads/BreakpointPad/Toolbar");

            grid.Children.Add(toolbar);

            this.control.listView.View = (GridView)res["breakpointsGridView"];
            this.control.listView.SetValue(GridViewColumnAutoSize.AutoWidthProperty, "35;50%;50%");
        }
        private void InitToolBar()
        {
            MainToolStrip.Items.Clear();
            ToolBarService _toolBarService = new ToolBarService();

            _toolBarService.Clear();
            _toolBarService.AddToolButton("增加角色", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.J角色添加, true, false, null);
            //{8846BB2A-7B61-4a8a-9ED2-293F6F0A4ABA}
            // _toolBarService.AddToolButton("删除角色", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.J角色删除, true, false, null);
            _toolBarService.AddToolSeparator();
            if (nTabControl1.SelectedTab.Name == "UserRes")
            {
                _toolBarService.AddToolButton("增加用户", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.R人员, true, false, null);
                _toolBarService.AddToolButton("修改用户", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.R人员修改, true, false, null);
                _toolBarService.AddToolButton("查找用户", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.C查找人员, true, false, null);
            }
            if (nTabControl1.SelectedTab.Name == "MenuRes" || nTabControl1.SelectedTab.Name == "WebRes")
            {
                _toolBarService.AddToolButton("增加菜单", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.C菜单添加, true, false, null);
                _toolBarService.AddToolButton("删除菜单", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.C菜单删除, true, false, null);
            }
            if (nTabControl1.SelectedTab.Name == "DictionaryRes")
            {
                _toolBarService.AddToolButton("增加常数", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.M模版添加, true, false, null);
                _toolBarService.AddToolButton("删除常数", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.M模版删除, true, false, null);
            }
            if (nTabControl1.SelectedTab.Name == "ReportRes")
            {
                _toolBarService.AddToolButton("增加报表", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.M明细添加, true, false, null);
                _toolBarService.AddToolButton("删除报表", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.M明细删除, true, false, null);
            }
            if (nTabControl1.SelectedTab.Name == "OrgRes")
            {
                _toolBarService.AddToolButton("保存权限", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.B保存, true, false, null);
            }

            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("退出", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.T退出, true, false, null);

            ArrayList toolButtons = _toolBarService.GetToolButtons();

            for (int i = 0; i < toolButtons.Count; i++)
            {
                this.MainToolStrip.Items.Add(toolButtons[i] as ToolStripItem);
            }
            for (int i = 0; i < MainToolStrip.Items.Count; i++)
            {
                this.MainToolStrip.Items[i].TextImageRelation = TextImageRelation.ImageAboveText;
            }
        }
Exemple #13
0
        /// <summary>
        /// Changes wordwrap settings if that property has changed.
        /// </summary>
        void PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.Key == "WordWrap")
            {
                SetWordWrap();
                ToolBarService.UpdateStatus(toolStrip.Items);
            }
            if (e.Key == "DefaultFont")
            {
                var font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", Core.WinForms.WinFormsResourceService.DefaultMonospacedFont.ToString()).ToString());

                textEditor.FontFamily = new FontFamily(font.FontFamily.Name);
                textEditor.FontSize   = Math.Round(font.Size * 96.0 / 72.0);
            }
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="neuObject"></param>
        /// <param name="param"></param>
        public virtual ToolBarService Init(object sender, object neuObject, object param)
        {
            // TODO:  添加 ucBaseControl.Init 实现
            if (BeginInit != null)
            {
                this.BeginInit(this, null);
            }
            tv = sender as TreeView;
            ToolBarService toolBarService = OnInit(sender, neuObject, param);

            if (EndInit != null)
            {
                this.EndInit(this, null);
            }
            return(toolBarService);
        }
Exemple #15
0
        public void Initialize()
        {
            UpdateFlowDirection();

            RibbonInitial();

            mainMenu.ItemsSource = MenuService.CreateMenuItems(this, this, mainMenuPath, activationMethod: "MainMenu", immediatelyExpandMenuBuildersForShortcuts: true);

            toolStrips = ICSharpCode.Core.WinForms.ToolbarService.CreateToolbars(this, toolStripPath);
            toolBars   = ToolBarService.CreateToolBars(this, this, toolBarPath);

            #region by hanz
            //foreach (System.Windows.Controls.ToolBar tb in toolBars)
            //{
            //    DockPanel.SetDock(tb, Dock.Top);
            //    dockPanel.Children.Insert(1, tb);
            //}
            #endregion

            DockPanel.SetDock(statusBar, Dock.Bottom);
            dockPanel.Children.Insert(dockPanel.Children.Count - 2, statusBar);

            UpdateMenu();

            AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnRequestNavigate));

            #region by hanz
            //Project.ProjectService.CurrentProjectChanged += SetProjectTitle;

            //FileService.FileRemoved += CheckRemovedOrReplacedFile;
            //FileService.FileReplaced += CheckRemovedOrReplacedFile;
            //FileService.FileRenamed += CheckRenamedFile;

            //FileService.FileRemoved += FileService.RecentOpen.FileRemoved;
            //FileService.FileRenamed += FileService.RecentOpen.FileRenamed;
            #endregion

            requerySuggestedEventHandler     = new EventHandler(CommandManager_RequerySuggested);
            CommandManager.RequerySuggested += requerySuggestedEventHandler;
            ResourceService.LanguageChanged += OnLanguageChanged;

            this.StatusBar.SetMessage("${res:MainWindow.StatusBar.ReadyMessage}");
        }
        private void InitToolBar()
        {
            ToolBarService _toolBarService = new ToolBarService();

            _toolBarService.AddToolButton("增加资源", "", NFC.Interface.Classes.Function.GetImage(Neusoft.NFC.Interface.Classes.EnumImageList.A添加), true, false, null);
            _toolBarService.AddToolButton("删除资源", "", NFC.Interface.Classes.Function.GetImage(Neusoft.NFC.Interface.Classes.EnumImageList.A添加), true, false, null);
            _toolBarService.AddToolButton("查找资源", "", NFC.Interface.Classes.Function.GetImage(Neusoft.NFC.Interface.Classes.EnumImageList.A添加), true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("保存权限", "", NFC.Interface.Classes.Function.GetImage(Neusoft.NFC.Interface.Classes.EnumImageList.A添加), true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("退出", "", NFC.Interface.Classes.Function.GetImage(Neusoft.NFC.Interface.Classes.EnumImageList.A添加), true, false, null);

            this.MainToolStrip.Items.AddRange(_toolBarService.GetToolStripButtons());
            this.MainToolStrip.Items[0].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[1].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[2].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[4].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[6].TextImageRelation = TextImageRelation.ImageAboveText;
        }
Exemple #17
0
        public void Initialize()
        {
            UpdateFlowDirection();

            var padDescriptors = AddInTree.BuildItems <PadDescriptor>(viewContentPath, this, false);

            ((SharpDevelopServiceContainer)SD.Services).AddFallbackProvider(new PadServiceProvider(padDescriptors));
            foreach (PadDescriptor content in padDescriptors)
            {
                ShowPad(content);
            }

            mainMenu.ItemsSource = MenuService.CreateMenuItems(this, this, mainMenuPath, activationMethod: "MainMenu", immediatelyExpandMenuBuildersForShortcuts: true);

            toolBars = ToolBarService.CreateToolBars(this, this, "/SharpDevelop/Workbench/ToolBar");
            foreach (ToolBar tb in toolBars)
            {
                DockPanel.SetDock(tb, Dock.Top);
                dockPanel.Children.Insert(1, tb);
            }
            DockPanel.SetDock(statusBar, Dock.Bottom);
            dockPanel.Children.Insert(dockPanel.Children.Count - 2, statusBar);

            Core.WinForms.MenuService.ExecuteCommand    = ExecuteCommand;
            Core.WinForms.MenuService.CanExecuteCommand = CanExecuteCommand;
            UpdateMenu();

            AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnRequestNavigate));
            Project.ProjectService.CurrentProjectChanged += SetProjectTitle;

            SharpDevelop.FileService.FileRemoved  += CheckRemovedOrReplacedFile;
            SharpDevelop.FileService.FileReplaced += CheckRemovedOrReplacedFile;
            SharpDevelop.FileService.FileRenamed  += CheckRenamedFile;

            SharpDevelop.FileService.FileRemoved += ((RecentOpen)SD.FileService.RecentOpen).FileRemoved;
            SharpDevelop.FileService.FileRenamed += ((RecentOpen)SD.FileService.RecentOpen).FileRenamed;

            requerySuggestedEventHandler        = new EventHandler(CommandManager_RequerySuggested);
            CommandManager.RequerySuggested    += requerySuggestedEventHandler;
            SD.ResourceService.LanguageChanged += OnLanguageChanged;

            SD.StatusBar.SetMessage("${res:MainWindow.StatusBar.ReadyMessage}");
        }
Exemple #18
0
        void InitializePadContent()
        {
            IReadOnlyList <string> tokens = SD.ParserService.TaskListTokens;

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

            toolBar = ToolBarService.CreateToolBar(contentPanel, this, "/SharpDevelop/Pads/TaskList/Toolbar");
            var items = (IList)toolBar.ItemsSource;

            foreach (string token in tokens)
            {
                items.Add(new Separator());
                items.Add(new TaskListTokensToolbarCheckBox(token));
            }

            toolBar.Items.OfType <ComboBox>().ForEach(b => b.MinWidth = 75);

            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            contentPanel.Children.Add(toolBar);
            contentPanel.Children.Add(taskView);
            Grid.SetRow(taskView, 1);

            taskView.ItemsSource       = tasks;
            taskView.MouseDoubleClick += TaskViewMouseDoubleClick;
            taskView.Style             = (Style) new TaskViewResources()["TaskListView"];
            taskView.ContextMenu       = MenuService.CreateContextMenu(taskView, DefaultContextMenuAddInTreeEntry);

            taskView.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, ExecuteCopy, CanExecuteCopy));
            taskView.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll));
        }
        public ErrorListPad()
        {
            instance   = this;
            properties = PropertyService.NestedProperties("ErrorListPad");

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

            SD.BuildService.BuildFinished    += ProjectServiceEndBuild;
            SD.ProjectService.SolutionOpened += OnSolutionOpen;
            SD.ProjectService.SolutionClosed += OnSolutionClosed;
            errors = new ObservableCollection <SDTask>(TaskService.Tasks.Where(t => t.TaskType != TaskType.Comment));

            toolBar = ToolBarService.CreateToolBar(contentPanel, this, "/SharpDevelop/Pads/ErrorList/Toolbar");

            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            contentPanel.Children.Add(toolBar);
            contentPanel.Children.Add(errorView);
            Grid.SetRow(errorView, 1);
            errorView.ItemsSource       = errors;
            errorView.MouseDoubleClick += ErrorViewMouseDoubleClick;
            errorView.Style             = (Style) new TaskViewResources()["TaskListView"];
            errorView.ContextMenu       = MenuService.CreateContextMenu(this, DefaultContextMenuAddInTreeEntry);

            errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, ExecuteCopy, CanExecuteCopy));
            errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll));

            InternalShowResults();
        }
Exemple #20
0
        public void Initialize(object mainWindow)
        {
            var    startupSettings = Current.GetRequiredService <StartupSettings>();
            string appNamePrefix   = "/" + startupSettings.ApplicationName;

            _mainWindow = mainWindow;

            // Initialize main menu items
            MainMenuItemsSource = MenuService.CreateMenuItems((System.Windows.UIElement)_mainWindow, this, appNamePrefix + mainMenuPathPostFix, activationMethod: "MainMenu", immediatelyExpandMenuBuildersForShortcuts: true);

            // Initialize toolbars
            ToolBarTrayItemsSource = ToolBarService.CreateToolBars(_mainWindow, this, appNamePrefix + toolBarPathPostFix);

            // Initialize context menu of document tabs
            DocumentContextMenuItemsSource = MenuService.CreateMenuItems((System.Windows.UIElement)_mainWindow, this, appNamePrefix + documentContextMenuPathPostFix, activationMethod: "ContextMenu", immediatelyExpandMenuBuildersForShortcuts: true);

            // Initialize pads (tool windows)
            var padDescriptors = AddInTree.BuildItems <PadDescriptor>(appNamePrefix + padContentPathPostFix, this, false);

            _padContentCollection.AddRange(padDescriptors.Select(x => x.PadContent));

            // Initialize status bar
            var statusBarService = Current.GetService <IStatusBarService>();

            if (statusBarService is IMVCController statusBarController)
            {
                if (statusBarController.ViewObject == null)
                {
                    Current.Gui.FindAndAttachControlTo(statusBarController);
                }
                _statusBarView = statusBarController.ViewObject;
            }

            // Initialize Icon
            IconSource = "Icons." + startupSettings.ApplicationName + "ApplicationIcon";

            Current.IProjectService.ProjectChanged += EhProjectChanged;
            Title = Current.IProjectService.GetMainWindowTitle();

            WorkbenchServices.StatusBar.SetMessage("${res:MainWindow.StatusBar.ReadyMessage}");
        }
Exemple #21
0
        private void InitToolBar()
        {
            MainToolStrip.Items.Clear();
            ToolBarService _toolBarService = new ToolBarService();

            _toolBarService.Clear();
            _toolBarService.AddToolButton("添加", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.R人员, true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("退出", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.T退出, true, false, null);

            ArrayList toolButtons = _toolBarService.GetToolButtons();

            for (int i = 0; i < toolButtons.Count; i++)
            {
                this.MainToolStrip.Items.Add(toolButtons[i] as ToolStripItem);
            }
            for (int i = 0; i < MainToolStrip.Items.Count; i++)
            {
                this.MainToolStrip.Items[i].TextImageRelation = TextImageRelation.ImageAboveText;
            }
        }
        private void InitToolBar()
        {
            ToolBarService _toolBarService = new ToolBarService();

            _toolBarService.AddToolButton("增加角色", "", (Image)Resource.增加16, true, false, null);
            _toolBarService.AddToolButton("删除角色", "", (Image)Resource.除16, true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("增加用户", "", (Image)Resource.修改16, true, false, null);
            _toolBarService.AddToolButton("删除用户", "", (Image)Resource.召回16, true, false, null);
            _toolBarService.AddToolButton("查找用户", "", (Image)Resource.查询16, true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("退出", "", (Image)Resource.退出16, true, false, null);

            this.MainToolStrip.Items.AddRange(_toolBarService.GetToolStripButtons());
            this.MainToolStrip.Items[0].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[1].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[3].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[4].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[5].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[7].TextImageRelation = TextImageRelation.ImageAboveText;
        }
        public SearchResultsPad()
        {
            if (instance != null)
            {
                throw new InvalidOperationException("Cannot create multiple instances");
            }
            instance = this;
            toolBar  = new ToolBar();
            ToolBarTray.SetIsLocked(toolBar, true);
            defaultToolbarItems = ToolBarService.CreateToolBarItems(dockPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar");
            foreach (object toolBarItem in defaultToolbarItems)
            {
                toolBar.Items.Add(toolBarItem);
            }

            DockPanel.SetDock(toolBar, Dock.Top);
            contentPlaceholder = new ContentPresenter();
            dockPanel          = new DockPanel {
                Children = { toolBar, contentPlaceholder }
            };
        }
Exemple #24
0
        public WatchPad()
        {
            var res = new CommonResources();

            res.InitializeComponent();

            panel = new Grid();

            toolBar = ToolBarService.CreateToolBar(toolBar, this, "/SharpDevelop/Pads/WatchPad/ToolBar");
            panel.Children.Add(toolBar);

            tree          = new SharpTreeView();
            tree.Root     = new WatchRootNode();
            tree.ShowRoot = false;
            tree.View     = (GridView)res["variableGridView"];
            tree.SetValue(GridViewColumnAutoSize.AutoWidthProperty, "50%;25%;25%");
            tree.MouseDoubleClick += delegate(object sender, MouseButtonEventArgs e) {
                if (this.tree.SelectedItem == null)
                {
                    AddWatch(focus: true);
                }
            };
            panel.Children.Add(tree);

            panel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            panel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            Grid.SetRow(tree, 1);

//			ProjectService.SolutionLoaded  += delegate { LoadNodes(); };
//			SD.ProjectService.CurrentSolution.PreferencesSaving += delegate { SaveNodes(); };
//			LoadNodes();

            WindowsDebugger.RefreshingPads += RefreshPad;
            RefreshPad();
        }
Exemple #25
0
        //by hanz
        //void SetProjectTitle(object sender, Project.ProjectEventArgs e)
        //{
        //    if (e.Project != null) {
        //        Title = e.Project.Name + " - " + ResourceService.GetString("MainWindow.DialogName");
        //    } else {
        //        Title = ResourceService.GetString("MainWindow.DialogName");
        //    }
        //}

        //by hanz
        //void CheckRemovedOrReplacedFile(object sender, FileEventArgs e)
        //{
        //    foreach (OpenedFile file in FileService.OpenedFiles)
        //    {
        //        if (FileUtility.IsBaseDirectory(e.FileName, file.FileName))
        //        {
        //            foreach (IViewContent content in file.RegisteredViewContents.ToArray())
        //            {
        //                // content.WorkbenchWindow can be null if multiple view contents
        //                // were in the same WorkbenchWindow and both should be closed
        //                // (e.g. Windows Forms Designer, Subversion History View)
        //                if (content.WorkbenchWindow != null)
        //                {
        //                    content.WorkbenchWindow.CloseWindow(true);
        //                }
        //            }
        //        }
        //    }
        //    Editor.PermanentAnchorService.FileDeleted(e);
        //}

        //by hanz
        //void CheckRenamedFile(object sender, FileRenameEventArgs e)
        //{
        //    if (e.IsDirectory) {
        //        foreach (OpenedFile file in FileService.OpenedFiles) {
        //            if (file.FileName != null && FileUtility.IsBaseDirectory(e.SourceFile, file.FileName)) {
        //                file.FileName = new FileName(FileUtility.RenameBaseDirectory(file.FileName, e.SourceFile, e.TargetFile));
        //            }
        //        }
        //    } else {
        //        OpenedFile file = FileService.GetOpenedFile(e.SourceFile);
        //        if (file != null) {
        //            file.FileName = new FileName(e.TargetFile);
        //        }
        //    }
        //    Editor.PermanentAnchorService.FileRenamed(e);
        //}

        /// <summary>
        /// 时刻监测Condition,更新界面
        /// </summary>
        void UpdateMenu()
        {
            MenuService.UpdateStatus(mainMenu.ItemsSource);

            if (toolBars != null)
            {
                foreach (System.Windows.Controls.ToolBar tb in toolBars)
                {
                    ToolBarService.UpdateStatus(tb.ItemsSource);
                }
            }

            if (toolStrips != null)
            {
                foreach (System.Windows.Forms.ToolStrip ts in toolStrips)
                {
                    ICSharpCode.Core.WinForms.ToolbarService.UpdateToolbar(ts);
                }
            }

            RibbonService.UpdateStatus(RibbonContainer);
        }
Exemple #26
0
        public CompilerMessageView()
        {
            instance = this;

            AddCategory(TaskService.BuildMessageViewCategory);

            textEditor.IsReadOnly  = true;
            textEditor.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/CompilerMessageView/ContextMenu");

            properties = ICSharpCode.Core.PropertyService.NestedProperties(OutputWindowOptionsPanel.OutputWindowsProperty);

            SetTextEditorFont();

            properties.PropertyChanged += new PropertyChangedEventHandler(PropertyChanged);

            MessageViewLinkElementGenerator.RegisterGenerators(textEditor.TextArea.TextView);
            textEditor.TextArea.TextView.ElementGenerators.OfType <LinkElementGenerator>().ForEach(x => x.RequireControlModifierForClick = false);

            toolStrip = ToolBarService.CreateToolBar(panel, this, "/SharpDevelop/Pads/CompilerMessageView/Toolbar");
            toolStrip.Items.OfType <ComboBox>().ForEach(b => b.MinWidth = 75);

            panel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            panel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            panel.Children.Add(toolStrip);
            panel.Children.Add(textEditor);
            Grid.SetRow(textEditor, 1);

            SetWordWrap();
            DisplayActiveCategory();
            SD.ProjectService.CurrentSolutionChanged += OnSolutionLoaded;

            SearchPanel.Install(textEditor);
        }
        private void InitToolBar()
        {
            ToolBarService _toolBarService = new ToolBarService();

            _toolBarService.AddToolButton("增加分类", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.F分类添加, true, false, null);
            _toolBarService.AddToolButton("删除分类", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.F分类删除, true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("增加菜单", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.C菜单添加, true, false, null);
            _toolBarService.AddToolButton("删除菜单", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.C菜单删除, true, false, null);
            _toolBarService.AddToolSeparator();
            _toolBarService.AddToolButton("退出", "", Neusoft.FrameWork.WinForms.Classes.EnumImageList.T退出, true, false, null);

            ArrayList toolButtons = _toolBarService.GetToolButtons();

            for (int i = 0; i < toolButtons.Count; i++)
            {
                this.MainToolStrip.Items.Add(toolButtons[i] as ToolStripItem);
            }
            this.MainToolStrip.Items[0].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[1].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[3].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[4].TextImageRelation = TextImageRelation.ImageAboveText;
            this.MainToolStrip.Items[6].TextImageRelation = TextImageRelation.ImageAboveText;
        }
Exemple #28
0
 protected override ToolBar BuildToolBar()
 {
     return(ToolBarService.CreateToolBar(console, this, debuggerConsoleToolBarTreePath));
 }
Exemple #29
0
        public BookmarkPad()
        {
            ToolBar toolbar = ToolBarService.CreateToolBar((UIElement)this.Control, this, "/SharpDevelop/Pads/BookmarkPad/Toolbar");

            this.control.Children.Add(toolbar);
        }
Exemple #30
0
 protected virtual ToolBar BuildToolBar()
 {
     return(ToolBarService.CreateToolBar(panel, this, toolBarTreePath));
 }