void UpdateMenu() { MenuService.UpdateStatus(mainMenu.ItemsSource); foreach (ToolBar tb in toolBars) { ToolBarService.UpdateStatus(tb.ItemsSource); } }
/// <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(); } }
/// <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); } }
//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); }