public FileListWarningDlg(WarningStyle buttons) { PreferenceKey = string.Format("LockedFilesWarningDlg_{0}", buttons); InitializeComponent(); this.Icon = Images.icon_p4vs_16px; DontGetLatestBtn.Visible = (buttons == WarningStyle.GetLatest || buttons == WarningStyle.UpdateSln); GetLatestBtn.Visible = (buttons == WarningStyle.GetLatest || buttons == WarningStyle.UpdateSln); OkBtn.Visible = (buttons == WarningStyle.Locked); if (buttons == WarningStyle.GetLatest) { Prompt = Resources.WarningStyle_GetLatest_Prompt; ReasonClmLbl = null; } else if (buttons == WarningStyle.UpdateSln) { Prompt = Resources.WarningStyle_GetLatestSln_Prompt; ReasonClmLbl = null; } else { Prompt = Resources.WarningStyle_Locked_Prompt; ReasonClmLbl = Resources.WarningStyle_Locked_WarningClmLbl; } }
public CodeEditorControl(CodeEditorContent content, OpenedFile file) { InitializeComponent(); _content = content; _extension = (CodeEditorExtension)content.ParentExtension; _file = file; SetupTextBox(); _errorStyle = new ErrorStyle(_extension.StyleMap.DefaultText.Description); _warningStyle = new WarningStyle(_extension.StyleMap.DefaultText.Description); contextMenuStrip1.Renderer = _extension.ExtensionHost.ControlManager.MenuRenderer; _componentMuiIdentifiers = new Dictionary <object, string>() { { this.cutToolStripMenuItem, "CodeEditorControl.ContextMenu.Cut" }, { this.copyToolStripMenuItem, "CodeEditorControl.ContextMenu.Copy" }, { this.pasteToolStripMenuItem, "CodeEditorControl.ContextMenu.Paste" }, { this.selectAllToolStripMenuItem, "CodeEditorControl.ContextMenu.SelectAll" }, }; _extension.ExtensionHost.UILanguageChanged += ExtensionHost_UILanguageChanged; _extension.ExtensionHost.BookmarkManager.Bookmarks.InsertedItem += Bookmarks_InsertedItem; _extension.ExtensionHost.BookmarkManager.Bookmarks.RemovedItem += Bookmarks_RemovedItem; _extension.ExtensionHost.ErrorManager.Errors.InsertedItem += Errors_InsertedItem; _extension.ExtensionHost.ErrorManager.Errors.RemovedItem += Errors_RemovedItem; _extension.ExtensionHost.ErrorManager.Errors.ClearedCollection += Errors_ClearedCollection; _extension.ExtensionHost.DebugStarted += ExtensionHost_DebugStarted; _extension.ExtensionHost.DebugStopped += ExtensionHost_DebugStopped; _instructionPointer = new CodeEditorInstructionPointer(TextBox, _extension.StyleMap.InstructionPointerStyle); if (_extension.ExtensionHost.IsDebugging) { ExtensionHost_DebugStarted(null, null); } ExtensionHost_UILanguageChanged(null, null); _extension.AppliedSettings += extension_AppliedSettings; extension_AppliedSettings(null, null); file.HasUnsavedDataChanged += file_HasUnsavedDataChanged; }
public static DialogResult Show(IList <string> files, IList <string> Reason, WarningStyle style) { FileListWarningDlg dlg = new FileListWarningDlg(style); for (int idx = 0; idx < files.Count; idx++) { string fileName = Path.GetFileName(files[idx]); string path = Path.GetDirectoryName(files[idx]); string locked = string.Empty; if ((Reason != null) && (idx < Reason.Count)) { locked = Reason[idx]; } ListViewItem item = new ListViewItem(new string[] { fileName, path, locked }); dlg.FilesList.Items.Add(item); } return(dlg.ShowDialog()); }