int IVsDropdownBarClient.GetComboTipText(int iCombo, out string pbstrText) { var itemText = GetActiveSelectionItem(iCombo)?.DisplayName ?? ""; pbstrText = itemText; if (iCombo == ProjectComboIndex) { var keybindingString = KeyBindingHelper.GetGlobalKeyBinding(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.MoveToDropdownBar); if (!String.IsNullOrEmpty(keybindingString)) { pbstrText += $" ({keybindingString})"; } pbstrText += Environment.NewLine + Environment.NewLine; pbstrText += "Use the dropdown to view and switch to other projects this file may belong to.."; return(VSConstants.S_OK); } pbstrText += Environment.NewLine + Environment.NewLine; pbstrText += "Use the dropdown to view and navigate to other items in the file."; return(VSConstants.S_OK); }
int IVsDropdownBarClient.GetComboTipText(int iCombo, out string pbstrText) { var selectedItemPreviewText = string.Empty; if (_dropdownBar.GetCurrentSelection(iCombo, out var selectionIndex) == VSConstants.S_OK && selectionIndex >= 0) { selectedItemPreviewText = GetItem(iCombo, selectionIndex).Text; } switch (iCombo) { case 0: var keybindingString = KeyBindingHelper.GetGlobalKeyBinding(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.MoveToDropdownBar); if (!string.IsNullOrWhiteSpace(keybindingString)) { pbstrText = string.Format(ServicesVSResources.Project_colon_0_1_Use_the_dropdown_to_view_and_switch_to_other_projects_this_file_may_belong_to, selectedItemPreviewText, keybindingString); } else { pbstrText = string.Format(ServicesVSResources.Project_colon_0_Use_the_dropdown_to_view_and_switch_to_other_projects_this_file_may_belong_to, selectedItemPreviewText); } return(VSConstants.S_OK); case 1: case 2: pbstrText = string.Format(ServicesVSResources._0_Use_the_dropdown_to_view_and_navigate_to_other_items_in_this_file, selectedItemPreviewText); return(VSConstants.S_OK); default: pbstrText = null; return(VSConstants.E_INVALIDARG); } }
int IVsDropdownBarClient.GetComboTipText(int iCombo, out string pbstrText) { int selectionIndex; var selectedItemPreviewText = string.Empty; if (_dropdownBar.GetCurrentSelection(iCombo, out selectionIndex) == VSConstants.S_OK && selectionIndex >= 0) { selectedItemPreviewText = GetItem(iCombo, selectionIndex).Text; } switch (iCombo) { case 0: var keybindingString = KeyBindingHelper.GetGlobalKeyBinding(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.MoveToDropdownBar); if (!string.IsNullOrWhiteSpace(keybindingString)) { pbstrText = string.Format(ServicesVSResources.ProjectNavBarTooltipWithShortcut, selectedItemPreviewText, keybindingString); } else { pbstrText = string.Format(ServicesVSResources.ProjectNavBarTooltipWithoutShortcut, selectedItemPreviewText); } return(VSConstants.S_OK); case 1: case 2: pbstrText = string.Format(ServicesVSResources.NavBarTooltip, selectedItemPreviewText); return(VSConstants.S_OK); default: pbstrText = null; return(VSConstants.E_INVALIDARG); } }
void DisplaySkillKeys(int i, KeyBindingHelper helper, Dictionary <KeyBindingNames, KeyCode> dict) { string s = ""; s = helper.GetKEyName(dict[KeyBindingNames.SkillKey1 + i]); skillhotbar[i].SetHotKeyText(s); }
void DisplayEquipment(KeyBindingHelper helper, Dictionary <KeyBindingNames, KeyCode> dict) { string s = helper.GetKEyName(dict[KeyBindingNames.HeadSlot]); headslot.SetHotKeyText(s); s = helper.GetKEyName(dict[KeyBindingNames.WeaponSlot]); weaponSlot.SetHotKeyText(s); }
static string GetTooltipText(CommandID commandId, string commandName) { var tooltipText = commandName; var keyBinding = KeyBindingHelper.GetGlobalKeyBinding(commandId.Guid, commandId.ID); if (!String.IsNullOrEmpty(keyBinding)) { tooltipText += $" ({keyBinding})"; } return(tooltipText); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); //KeyBindingHelper.SetKeyBindings(this, tagView.TagToolbar.wrenchMenu.Items); KeyBindingHelper.SetKeyBindings(this, tagView.MainMenu.Menu.Items); InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoBackCommand, Key.Left, ModifierKeys.Alt)); InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoForwardCommand, Key.Right, ModifierKeys.Alt)); InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoUpCommand, Key.Up, ModifierKeys.Alt)); InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.SelectAllCommand, Key.A, ModifierKeys.Control)); InputBindings.Add(new KeyBinding(new DelegateCommand(_viewModel.DirectoryViewModel.FocusAddressTextBox), Key.D, ModifierKeys.Alt)); MainWindowSettings settings; if (SettingsFile.TryLoad("mainWindow.json", out settings)) { try { // Splitter/InitialDirectory settings tagView.FileExplorer.GridSplitterPosition = new GridLength(settings.GridSplitterPosition); IDirectoryController directoryController = tagView.FileExplorer.DirectoryController; // TODO: Need a better way to get this. directoryController.InitialDirectory = settings.Directory; // Column settings var columns = tagView.FileExplorer.GetFileViewColumns(); foreach (var column in columns) { string name = column.GetValue(DataGridUtil.NameProperty).ToString(); foreach (var kvp in settings.ColumnSettings) { if (kvp.Key == name) { double width = kvp.Value.Width; bool isStar = kvp.Value.IsStar; column.Width = new DataGridLength(width, isStar ? DataGridLengthUnitType.Star : DataGridLengthUnitType.Pixel); column.DisplayIndex = kvp.Value.DisplayIndex; } } } } catch { // TODO: Log error? } } }
public void InitList(HotKeys hotkeys) { ToggleOn(); KeyBindingHelper helper = new KeyBindingHelper(); textlabels = new List <TMP_Text>(); buttonlabels = new List <TextButton>(); KeyBindingNames[] names = hotkeys.GetKeys(); foreach (KeyBindingNames n in names) { InitLabel(helper.GetBindingNames(n)); InitButton(n, helper.GetKEyName(hotkeys.hotkeys[n])); } }
void DisplayKeys() { KeyBindingHelper helper = new KeyBindingHelper(); Dictionary <KeyBindingNames, KeyCode> k = boardManager.inputFSM.currentState.inputHandler.hotkeys.hotkeys; for (int i = 0; i < 10; i++) { DisplaySkillKeys(i, helper, k); } for (int i = 0; i < 5; i++) { DisplayInventoryKeys(i, helper, k); } DisplayEquipment(helper, k); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); KeyBindingHelper.SetKeyBindings(this, MainMenu.Menu.Items); }
void DisplayInventoryKeys(int i, KeyBindingHelper helper, Dictionary <KeyBindingNames, KeyCode> dict) { string s = helper.GetKEyName(dict[KeyBindingNames.InventoryKey1 + i]); inventoryhotbar[i].SetHotKeyText(s); }