public void CreateTabs() { string[] tabNames = new string[_views.Length]; string[] shortcuts = new string[_views.Length]; for (int i = 0; i < tabNames.Length; i++) { tabNames[i] = _views[i].Text; if (_views[i].Shortcut != Shortcut.None) { shortcuts[i] = KeyboardHelper.FormatShortcutString(_views[i].Shortcut); } } _postEditorFooter = new PostEditorFooter(); _postEditorFooter.TabNames = tabNames; _postEditorFooter.Shortcuts = shortcuts; _postEditorFooter.Dock = DockStyle.Bottom; _postEditorFooter.SelectedTabChanged += tabsControl_SelectedTabChanged; _postEditorFooter.SetStatusMessage(Res.Get(StringId.StatusDraftUnsaved)); _editorContainer.Controls.Add(_postEditorFooter); }
/// <summary> /// Format a shortcut as a string. /// </summary> /// <param name="shortcut">Shortcut to format.</param> /// <returns>String format of shortcut.</returns> private string FormatShortcutString(Shortcut shortcut) { return(KeyboardHelper.FormatShortcutString(shortcut)); }