static ExportAllConversationsCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.E, ModifierKeys.Control | ModifierKeys.Shift)); ExportAllConversations = new RoutedUICommand("Export All Conversations", "Export All Conversations", typeof(ExportAllConversationsCommand), gestures); }
static CustomCmd() { // Инициализация команды InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.N, ModifierKeys.Control, "Ctrl + Shift + N")); add = new RoutedUICommand("Add", "Add", typeof(CustomCmd), inputs); }
static FileCommands() { Exit = new RoutedUICommand( "E_xit", "Exit", typeof(FileCommands)); }
void AddFindMenuItems(MenuItem itemEdit) { // Find menu item. MenuItem itemFind = new MenuItem(); itemFind.Header = "_Find..."; itemFind.Command = ApplicationCommands.Find; itemEdit.Items.Add(itemFind); CommandBindings.Add(new CommandBinding( ApplicationCommands.Find, FindOnExecute, FindCanExecute)); // The Find Next item requires a custom RoutedUICommand. InputGestureCollection coll = new InputGestureCollection(); coll.Add(new KeyGesture(Key.F3)); RoutedUICommand commFindNext = new RoutedUICommand("Find _Next", "FindNext", GetType(), coll); MenuItem itemNext = new MenuItem(); itemNext.Command = commFindNext; itemEdit.Items.Add(itemNext); CommandBindings.Add( new CommandBinding(commFindNext, FindNextOnExecute, FindNextCanExecute)); MenuItem itemReplace = new MenuItem(); itemReplace.Header = "_Replace..."; itemReplace.Command = ApplicationCommands.Replace; itemEdit.Items.Add(itemReplace); CommandBindings.Add(new CommandBinding( ApplicationCommands.Replace, ReplaceOnExecute, FindCanExecute)); }
static ExportSingleConversationCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.E, ModifierKeys.Control)); ExportSingleConversation = new RoutedUICommand("Export Selected Conversation", "Export Selected Conversation", typeof(ExportSingleConversationCommand), gestures); }
static MainView() { LoadData = new RoutedUICommand("LoadData", "LoadData", typeof(MainView)); ViewEvent = new RoutedUICommand("ViewEvent", "ViewEvent", typeof(MainView)); ViewLogs = new RoutedUICommand("ViewLogs", "ViewLogs", typeof(MainView)); ClearLogs = new RoutedUICommand("ClearLogs", "ClearLogs", typeof(MainView)); }
static ShowSettingsDialogCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.D3, ModifierKeys.Control)); ShowSettingsDialog = new RoutedUICommand("Settings", "Settings", typeof(ShowSettingsDialogCommand), gestures); }
static ShareOnFacebookCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.F, ModifierKeys.Control | ModifierKeys.Shift)); ShareOnFacebook = new RoutedUICommand("Share on Facebook", "Share on Facebook", typeof(ShareOnFacebookCommand), gestures); }
static OrderByAuthor() { InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.A, ModifierKeys.Alt, "Alt+A")); orderByAuthor = new RoutedUICommand( "OrderByAuthorCmd", "OrderByAuthorCmd", typeof(OrderByAuthor), inputs); }
static OrderByTitle() { InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.T, ModifierKeys.Alt, "Alt+T")); orderByTitle = new RoutedUICommand( "OrderByTitleCmd", "OrderByTitleCmd", typeof(OrderByTitle), inputs); }
static DataCommands() { //// Инициализация команды. InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.Escape, ModifierKeys.None, "Esc")); escape = new RoutedUICommand( "Escape", "Escape", typeof(DataCommands), inputs); InputGestureCollection inputs2 = new InputGestureCollection(); inputs2.Add(new KeyGesture(Key.N, ModifierKeys.Control, "Ctr+N")); newGame = new RoutedUICommand( "NewGame", "NewGame", typeof(DataCommands), inputs2); InputGestureCollection inputs3 = new InputGestureCollection(); inputs3.Add(new KeyGesture(Key.M, ModifierKeys.Control, "Ctr+M")); mix = new RoutedUICommand( "Mix", "Mix", typeof(DataCommands), inputs3); InputGestureCollection inputs4 = new InputGestureCollection(); inputs4.Add(new KeyGesture(Key.S, ModifierKeys.Control, "Ctr+S")); solve = new RoutedUICommand( "Solve", "Solve", typeof(DataCommands), inputs4); InputGestureCollection inputs5 = new InputGestureCollection(); inputs5.Add(new KeyGesture(Key.L, ModifierKeys.Control, "Ctr+L")); loadPicture = new RoutedUICommand( "LoadPicture", "LoadPicture", typeof(DataCommands), inputs5); InputGestureCollection inputs6 = new InputGestureCollection(); inputs6.Add(new KeyGesture(Key.P, ModifierKeys.Control)); showSolution = new RoutedUICommand( "ShowSolution", "ShowSolution", typeof(DataCommands), inputs6); }
static CustomCommands() { SplitSegmentCommand = new RoutedUICommand( "Split Segment", "SplitSegment", typeof(CustomCommands), null); JoinSegmentsCommand = new RoutedUICommand( "Join Segments", "JoinSegments", typeof(CustomCommands), null); }
static Commands() { Duplicate = new RoutedUICommand("Duplicate", "Duplicate", typeof(BackpackView)); Bank = new RoutedUICommand("Bank", "Bank", typeof(BackpackView)); CopyCode = new RoutedUICommand("Copy Code", "CopyCode", typeof(BackpackView)); Delete = new RoutedUICommand("Delete", "Delete", typeof(BackpackView)); }
static Commands() { Connect = new RoutedUICommand("Connect", "Connect", typeof(Commands)); ConnectAs = new RoutedUICommand("Connect", "Connect", typeof(Commands)); CopyAll = new RoutedUICommand("Copy", "Copy", typeof(Commands)); Close = ApplicationCommands.Close; ApplySettings = new RoutedUICommand("Apply", "Apply", typeof(Commands)); ResetSettings = new RoutedUICommand("Reset", "Reset", typeof(Commands)); AddUser = new RoutedUICommand("Add", "Add", typeof(Commands)); RemoveUser = new RoutedUICommand("Remove", "Remove", typeof(Commands)); EditUser = new RoutedUICommand("Edit", "Edit", typeof(Commands)); ChangeUserPassword = new RoutedUICommand("New Password", "NewPassword", typeof(Commands)); ChangeAdminPassword = new RoutedUICommand("Change Password", "ChangePassword", typeof(Commands)); ServiceControl = new RoutedUICommand("Service Control", "ServiceControl", typeof(Commands)); OpenService = new RoutedUICommand("Open", "OpenService", typeof(Commands)); StartService = new RoutedUICommand("Start", "StartService", typeof(Commands)); StopService = new RoutedUICommand("Stop", "StopService", typeof(Commands)); ShellExecute = new RoutedUICommand("Shell Execute", "ShellExecute", typeof(Commands)); ConfigTurnServer = new RoutedUICommand("Configure", "ConfigTurnServer", typeof(Commands)); ValidateXml = new RoutedUICommand("Validate", "Validate Configuration", typeof(Commands), new InputGestureCollection() { new KeyGesture(Key.T, ModifierKeys.Control), }); LoadXml = new RoutedUICommand("Load", "Load Configuration", typeof(Commands)); LoadDefaultXml = new RoutedUICommand("Load Default", "Load Default Configuration", typeof(Commands)); SaveXml = new RoutedUICommand("Save", "Save Configuration", typeof(Commands), new InputGestureCollection() { new KeyGesture(Key.S, ModifierKeys.Control), }); AddVoipProvider = new RoutedUICommand("Add", "Add", typeof(Commands)); RemoveVoipProvider = new RoutedUICommand("Remove", "Remove", typeof(Commands)); }
static GlobalCommands() { HyperlinkCommand = new RoutedUICommand("HyperlinkCommand", "HyperlinkCommand", typeof(GlobalCommands)); // Register CommandBinding for all windows. CommandManager.RegisterClassCommandBinding(typeof(FrameworkElement), new CommandBinding(HyperlinkCommand, HyperlinkCommandExecuted, HyperlinkCommandCanExecute)); }
static DataCommands() { InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.R, ModifierKeys.Control, "Ctrl+R")); requery = new RoutedUICommand( "Requery", "Requery", typeof(DataCommands), inputs); }
public MainWindow() { SOTC_BindingErrorTracer.BindingErrorTraceListener.SetTrace(); this.InitializeComponent(); /* // Insert code required on object creation below this point. KeyBinding ib = new KeyBinding( GlobalCommands.IncrementSectionNumber, new KeyGesture(Key.U, ModifierKeys.Control)); this.InputBindings.Add(ib); */ incrementCenterIndexCommand = new RoutedUICommand("+", "IncrementCenterIndexCommand", typeof(MainWindow)); decrementCenterIndexCommand = new RoutedUICommand("-", "DecrementCenterIndexCommand", typeof(MainWindow)); CommandBinding cb = new CommandBinding(incrementCenterIndexCommand, OnIncrementSectionNumber); this.CommandBindings.Add(cb); cb = new CommandBinding(decrementCenterIndexCommand, OnDecrementSectionNumber); this.CommandBindings.Add(cb); GlobalCommands.IncrementSectionNumber.RegisterCommand(incrementCenterIndexCommand); GlobalCommands.IncrementSectionNumber.RegisterCommand(decrementCenterIndexCommand); //GlobalCommands.IncrementSectionNumber.Execute(null); OnStartup(null); }
static AppCommands() { TestCommand = new RoutedUICommand("", "TestCommand", typeof(AppCommands)); ApplyCommand = new RoutedUICommand("", "ApplyCommand", typeof(AppCommands)); CancelCommand = new RoutedUICommand("", "CancelCommand", typeof(AppCommands)); AvailablePortsCommand = new RoutedUICommand(); }
static CopyConversationTextFormattedCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Shift)); CopyConversationTextFormatted = new RoutedUICommand("Copy Formatted", "Copy Formatted", typeof(CopyConversationTextFormattedCommand), gestures); }
string strFindWhat = "", strReplaceWith = ""; // strFindWhat : �˻��� ���ڿ� , strReplaceWith : �˻��� ���ڿ� #endregion Fields #region Methods // ======================================================================================================================= // �� �ʱ�ȭ �� ������... void AddFindMenuItems(MenuItem itemEdit) { // Find �� �� �����... MenuItem itemFind = new MenuItem(); // itemFind �� �߰� itemFind.Header = "_Find..."; // Herder ���� itemFind.Command = ApplicationCommands.Find; // Command�� Find ���� itemEdit.Items.Add(itemFind); // itemEdit�� itemFind �߰� CommandBindings.Add(new CommandBinding( ApplicationCommands.Find, FindOnExecute, FindCanExecute)); // FindOnExecute, FindCanExecute �̺�Ʈ ���� // ------------------------------------------------------------------------------------------------------------------- // Ŀ���� RoutedUICommand�� Find Next ���� �ʿ� InputGestureCollection coll = new InputGestureCollection(); // RoutedUICommand�� �߰��� coll ���� coll.Add(new KeyGesture(Key.F3)); // coll�� F3 ����Ű ��� RoutedUICommand commFindNext = new RoutedUICommand("Find _Next", "FindNext", GetType(), coll); // FindNext ����(text, name, type, gestures) MenuItem itemNext = new MenuItem(); // itemNext �� �߰� itemNext.Command = commFindNext; // ������ ���� commFindNext ���� itemEdit.Items.Add(itemNext); // itemEdit�� itemNext �߰� CommandBindings.Add( new CommandBinding(commFindNext, FindNextOnExecute, FindNextCanExecute)); // FindNextOnExecute, FindNextCanExecute �̺�Ʈ ���� // ------------------------------------------------------------------------------------------------------------------- MenuItem itemReplace = new MenuItem(); // itemReplace �� �߰� itemReplace.Header = "_Replace..."; // Herder ���� itemReplace.Command = ApplicationCommands.Replace; // Command�� Replace ���� itemEdit.Items.Add(itemReplace); // itemEdit�� itemReplace �߰� CommandBindings.Add(new CommandBinding( ApplicationCommands.Replace, ReplaceOnExecute, FindCanExecute));// ReplaceOnExecute, FindCanExecute �̺�Ʈ ���� }
static SwitchToConversationViewCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.D1, ModifierKeys.Control)); SwitchToConversationView = new RoutedUICommand("Conversation View", "Conversation View", typeof(SwitchToConversationViewCommand), gestures); }
static Commands() { // Initialize the commands InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.F, ModifierKeys.Control | ModifierKeys.Shift, "Ctrl+Shift+F")); addFolderEntity = new RoutedUICommand("Add Folder", "AddFolder", typeof(Commands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.L, ModifierKeys.Control | ModifierKeys.Shift, "Ctrl+Shift+L")); addFileEntity = new RoutedUICommand("Add File", "AddFile", typeof(Commands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.Delete, ModifierKeys.Control, "Ctrl+Del")); removeEntity = new RoutedUICommand("Remove Entity", "RemoveEntity", typeof(Commands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.Delete, ModifierKeys.Control | ModifierKeys.Shift, "Ctrl+Shift+Del")); removeAllEntities = new RoutedUICommand("Remove All Entities", "RemoveAllEntities", typeof(Commands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.F7, ModifierKeys.None, "F7")); buildPackage = new RoutedUICommand("Build Package", "BuildPackage", typeof(Commands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.F2, ModifierKeys.None, "F2")); renameEntity = new RoutedUICommand("Rename Entity", "RenameEntity", typeof(Commands), inputs); }
public SimpleRoutedCommand(string text) { RoutedUICommand routedCommand = new RoutedUICommand(); routedCommand.Text = text; _routedCommand = routedCommand; init(); }
static Commands() { Quit = new RoutedUICommand("Quit game", "Quit", typeof (Commands)); LoadDeck = new RoutedUICommand("Load a deck", "LoadDeck", typeof (Commands)); LoadDeck.InputGestures.Add(new KeyGesture(Key.L, ModifierKeys.Control)); NewDeck = new RoutedUICommand("Create a new empty deck", "NewDeck", typeof (Commands)); NewDeck.InputGestures.Add(new KeyGesture(Key.N, ModifierKeys.Control)); SaveDeck = new RoutedUICommand("Save the deck", "SaveDeck", typeof (Commands)); SaveDeck.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control)); SaveDeckAs = new RoutedUICommand("Save the deck under a new name", "SaveDeckAs", typeof (Commands)); SaveDeckAs.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control | ModifierKeys.Shift)); FullScreen = new RoutedUICommand("Full Screen", "FullScreen", typeof (Commands)); FullScreen.InputGestures.Add(new KeyGesture(Key.F11)); AlwaysShowProxy = new RoutedUICommand("Always Show Proxy", "AlwaysShowProxy", typeof(Commands)); AlwaysShowProxy.InputGestures.Add(new KeyGesture(Key.F12)); ResetGame = new RoutedUICommand("Reset game", "ResetGame", typeof (Commands)); Chat = new RoutedUICommand("Activate chat textbox", "Chat", typeof (Commands)); Chat.InputGestures.Add(new KeyGesture(Key.T, ModifierKeys.Control)); LimitedGame = new RoutedUICommand("Start a limited game", "LimitedGame", typeof (Commands)); LimitedGame.InputGestures.Add(new KeyGesture(Key.L, ModifierKeys.Control | ModifierKeys.Shift)); }
static WikiCommands() { createLinkFromSelection = new RoutedUICommand( "Create Link from Selection", "CreateLinkFromSelection", typeof(WikiCommands)); }
static IECommands() { #region menu InputGestureCollection inputsNew = new InputGestureCollection(); inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) ); New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew ); Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) ); InputGestureCollection inputsQuit = new InputGestureCollection(); inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) ); Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit ); InputGestureCollection inputsAbout = new InputGestureCollection(); inputsAbout.Add( new KeyGesture( Key.F1 ) ); About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout ); #endregion #region aboutDlg InputGestureCollection inputsAboutOk = new InputGestureCollection(); inputsAboutOk.Add( new KeyGesture( Key.Enter ) ); AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk ); #endregion }
static CopyGraphCommand() { InputGestureCollection gestures = new InputGestureCollection(); gestures.Add(new KeyGesture(Key.C, ModifierKeys.Control)); CopyGraph = new RoutedUICommand("Copy Graph", "Copy Graph", typeof(CopyGraphCommand), gestures); }
static HotkeyCommands() { InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.Q, ModifierKeys.Control, "Ctrl+Q")); exit = new RoutedUICommand("Exit", "Exit", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.D, ModifierKeys.Control, "Ctrl+D")); remove = new RoutedUICommand("Remove desktop", "Remove desktop", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.F, ModifierKeys.Control, "Ctrl+F")); clear_all = new RoutedUICommand("Clear all", "Clear all", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.G, ModifierKeys.Control, "Ctrl+G")); clear_lan = new RoutedUICommand("Clear selected LAN", "Clear selected LAN", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.T, ModifierKeys.Control, "Ctrl+T")); set_stat_ip = new RoutedUICommand("Set static IP", "Set static IP", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.U, ModifierKeys.Control, "Ctrl+U")); unset_stat_ip = new RoutedUICommand("Unset static IP", "Unset static IP", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.M, ModifierKeys.Control, "Ctrl+M")); move_to = new RoutedUICommand("Move to", "Move to", typeof(HotkeyCommands), inputs); inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.K, ModifierKeys.Control, "Ctrl+K")); combine_lans = new RoutedUICommand("Combine LAN's", "Combine LAN's", typeof(HotkeyCommands), inputs); }
static Hotkeys() { InputGestureCollection inputs = new InputGestureCollection(); inputs.Add(new KeyGesture(Key.X, ModifierKeys.Alt, "Alt+X")); ex = new RoutedUICommand("Exit", "Exit", typeof(Hotkeys), inputs); inputs = new InputGestureCollection(); }
static CustomerFormCommands() { _closeTab = new RoutedUICommand("closeTab", "_closeTab", typeof(CustomerFormCommands)); _addNewCustomer = new RoutedUICommand("addNewCustomer", "addNewCustomer", typeof(CustomerFormCommands)); _delCustomer = new RoutedUICommand("deleteCustomer", "deleteCustomer", typeof(CustomerFormCommands)); _viewAllCustomers = new RoutedUICommand("viewAllCustomers", "viewAllCustomers", typeof(CustomerFormCommands)); }
/// <summary> /// Creates the static resources used by this class. /// </summary> static RowHeaderCanvas() { // This value is used to prevent modifications to the colum header. Once frozen, selecting a part of the header will // select the entire row. When not frozen, dragging rows around will change the order and size of the rows. RowHeaderCanvas.IsHeaderFrozenProperty = DependencyProperty.Register("IsHeaderFrozen", typeof(object), typeof(RowHeaderCanvas), new FrameworkPropertyMetadata(true)); // Select Row Command RowHeaderCanvas.FreezeRowHeaders = new RoutedUICommand("FreezeRowHeaders", "Freeze Row Headers", typeof(RowHeaderCanvas)); }
private static RoutedUICommand _EnsureCommand(CommandId idCommand) { if (idCommand >= 0 && idCommand < CommandId.Last) { lock (_internalCommands.SyncRoot) { if (_internalCommands[(int)idCommand] == null) { RoutedUICommand newCommand = CommandLibraryHelper.CreateUICommand( GetPropertyName(idCommand), typeof(ApplicationCommands), (byte)idCommand, GetRequiredPermissions(idCommand)); _internalCommands[(int)idCommand] = newCommand; } } return(_internalCommands[(int)idCommand]); } return(null); }
/// <summary> /// Create the static resources used by this test module. /// </summary> static Commands() { // Routed Commands Commands.ClearCross = new RoutedUICommand("Clear Cross", "ClearCross", typeof(Commands)); Commands.CreateAccessControlList = new RoutedUICommand("Create Access Control List", "CreateAccessControlList", typeof(Commands)); Commands.CreateEquityOrders = new RoutedUICommand("Create Equity Orders...", "CreateEquityOrders", typeof(Commands)); Commands.CreateFixedIncomeOrders = new RoutedUICommand("Create Fixed Income Orders...", "CreateFixedIncomeOrders", typeof(Commands)); Commands.DestroyOrders = new RoutedUICommand("Destroy Orders", "DestroyOrders", typeof(Commands)); Commands.LoadDebtReport = new RoutedUICommand("Load Debt Report...", "LoadDebtReport", typeof(Commands)); Commands.LoadEquityReport = new RoutedUICommand("Load Equity Report...", "LoadEquityReport", typeof(Commands)); Commands.LoadDebtNegotiatorInventory = new RoutedUICommand("Load Debt Negotiator Inventory...", "LoadDebtNegotiatorData", typeof(Commands)); Commands.LoadDebtHolderInventory = new RoutedUICommand("Load Debt Holder Inventory...", "LoadDebtHolderData", typeof(Commands)); Commands.SimulateMarket = new RoutedUICommand("Simulate Market...", "SimulateMarket", typeof(Commands)); // Global Key Gestures Commands.ClearCross.InputGestures.Add(new KeyGesture(Key.C, ModifierKeys.Alt)); Commands.CreateEquityOrders.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Alt)); Commands.CreateFixedIncomeOrders.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Alt)); Commands.DestroyOrders.InputGestures.Add(new KeyGesture(Key.D, ModifierKeys.Alt)); Commands.LoadEquityReport.InputGestures.Add(new KeyGesture(Key.L, ModifierKeys.Alt)); Commands.SimulateMarket.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Alt)); }
private static RoutedUICommand GetKnownCommand(string localName, Type ownerType) { RoutedUICommand knownCommand = null; bool searchAll = false; if (ownerType == null) { searchAll = true; } if (ownerType == typeof(NavigationCommands) || ((null == knownCommand) && searchAll)) { switch (localName) { case "BrowseBack": knownCommand = NavigationCommands.BrowseBack; break; case "BrowseForward": knownCommand = NavigationCommands.BrowseForward; break; case "BrowseHome": knownCommand = NavigationCommands.BrowseHome; break; case "BrowseStop": knownCommand = NavigationCommands.BrowseStop; break; case "Refresh": knownCommand = NavigationCommands.Refresh; break; case "Favorites": knownCommand = NavigationCommands.Favorites; break; case "Search": knownCommand = NavigationCommands.Search; break; case "IncreaseZoom": knownCommand = NavigationCommands.IncreaseZoom; break; case "DecreaseZoom": knownCommand = NavigationCommands.DecreaseZoom; break; case "Zoom": knownCommand = NavigationCommands.Zoom; break; case "NextPage": knownCommand = NavigationCommands.NextPage; break; case "PreviousPage": knownCommand = NavigationCommands.PreviousPage; break; case "FirstPage": knownCommand = NavigationCommands.FirstPage; break; case "LastPage": knownCommand = NavigationCommands.LastPage; break; case "GoToPage": knownCommand = NavigationCommands.GoToPage; break; case "NavigateJournal": knownCommand = NavigationCommands.NavigateJournal; break; } } if (ownerType == typeof(ApplicationCommands) || ((null == knownCommand) && searchAll)) { switch (localName) { case "Cut": knownCommand = ApplicationCommands.Cut; break; case "Copy": knownCommand = ApplicationCommands.Copy; break; case "Paste": knownCommand = ApplicationCommands.Paste; break; case "Undo": knownCommand = ApplicationCommands.Undo; break; case "Redo": knownCommand = ApplicationCommands.Redo; break; case "Delete": knownCommand = ApplicationCommands.Delete; break; case "Find": knownCommand = ApplicationCommands.Find; break; case "Replace": knownCommand = ApplicationCommands.Replace; break; case "Help": knownCommand = ApplicationCommands.Help; break; case "New": knownCommand = ApplicationCommands.New; break; case "Open": knownCommand = ApplicationCommands.Open; break; case "Save": knownCommand = ApplicationCommands.Save; break; case "SaveAs": knownCommand = ApplicationCommands.SaveAs; break; case "Close": knownCommand = ApplicationCommands.Close; break; case "Print": knownCommand = ApplicationCommands.Print; break; case "CancelPrint": knownCommand = ApplicationCommands.CancelPrint; break; case "PrintPreview": knownCommand = ApplicationCommands.PrintPreview; break; case "Properties": knownCommand = ApplicationCommands.Properties; break; case "ContextMenu": knownCommand = ApplicationCommands.ContextMenu; break; case "CorrectionList": knownCommand = ApplicationCommands.CorrectionList; break; case "SelectAll": knownCommand = ApplicationCommands.SelectAll; break; case "Stop": knownCommand = ApplicationCommands.Stop; break; case "NotACommand": knownCommand = ApplicationCommands.NotACommand; break; } } if (ownerType == typeof(ComponentCommands) || ((null == knownCommand) && searchAll)) { switch (localName) { case "ScrollPageLeft": knownCommand = ComponentCommands.ScrollPageLeft; break; case "ScrollPageRight": knownCommand = ComponentCommands.ScrollPageRight; break; case "ScrollPageUp": knownCommand = ComponentCommands.ScrollPageUp; break; case "ScrollPageDown": knownCommand = ComponentCommands.ScrollPageDown; break; case "ScrollByLine": knownCommand = ComponentCommands.ScrollByLine; break; case "MoveLeft": knownCommand = ComponentCommands.MoveLeft; break; case "MoveRight": knownCommand = ComponentCommands.MoveRight; break; case "MoveUp": knownCommand = ComponentCommands.MoveUp; break; case "MoveDown": knownCommand = ComponentCommands.MoveDown; break; case "ExtendSelectionUp": knownCommand = ComponentCommands.ExtendSelectionUp; break; case "ExtendSelectionDown": knownCommand = ComponentCommands.ExtendSelectionDown; break; case "ExtendSelectionLeft": knownCommand = ComponentCommands.ExtendSelectionLeft; break; case "ExtendSelectionRight": knownCommand = ComponentCommands.ExtendSelectionRight; break; case "MoveToHome": knownCommand = ComponentCommands.MoveToHome; break; case "MoveToEnd": knownCommand = ComponentCommands.MoveToEnd; break; case "MoveToPageUp": knownCommand = ComponentCommands.MoveToPageUp; break; case "MoveToPageDown": knownCommand = ComponentCommands.MoveToPageDown; break; case "SelectToHome": knownCommand = ComponentCommands.SelectToHome; break; case "SelectToEnd": knownCommand = ComponentCommands.SelectToEnd; break; case "SelectToPageDown": knownCommand = ComponentCommands.SelectToPageDown; break; case "SelectToPageUp": knownCommand = ComponentCommands.SelectToPageUp; break; case "MoveFocusUp": knownCommand = ComponentCommands.MoveFocusUp; break; case "MoveFocusDown": knownCommand = ComponentCommands.MoveFocusDown; break; case "MoveFocusBack": knownCommand = ComponentCommands.MoveFocusBack; break; case "MoveFocusForward": knownCommand = ComponentCommands.MoveFocusForward; break; case "MoveFocusPageUp": knownCommand = ComponentCommands.MoveFocusPageUp; break; case "MoveFocusPageDown": knownCommand = ComponentCommands.MoveFocusPageDown; break; } } if (ownerType == typeof(EditingCommands) || ((null == knownCommand) && searchAll)) { switch (localName) { case "ToggleInsert": knownCommand = EditingCommands.ToggleInsert; break; case "Delete": knownCommand = EditingCommands.Delete; break; case "Backspace": knownCommand = EditingCommands.Backspace; break; case "DeleteNextWord": knownCommand = EditingCommands.DeleteNextWord; break; case "DeletePreviousWord": knownCommand = EditingCommands.DeletePreviousWord; break; case "EnterParagraphBreak": knownCommand = EditingCommands.EnterParagraphBreak; break; case "EnterLineBreak": knownCommand = EditingCommands.EnterLineBreak; break; case "TabForward": knownCommand = EditingCommands.TabForward; break; case "TabBackward": knownCommand = EditingCommands.TabBackward; break; case "MoveRightByCharacter": knownCommand = EditingCommands.MoveRightByCharacter; break; case "MoveLeftByCharacter": knownCommand = EditingCommands.MoveLeftByCharacter; break; case "MoveRightByWord": knownCommand = EditingCommands.MoveRightByWord; break; case "MoveLeftByWord": knownCommand = EditingCommands.MoveLeftByWord; break; case "MoveDownByLine": knownCommand = EditingCommands.MoveDownByLine; break; case "MoveUpByLine": knownCommand = EditingCommands.MoveUpByLine; break; case "MoveDownByParagraph": knownCommand = EditingCommands.MoveDownByParagraph; break; case "MoveUpByParagraph": knownCommand = EditingCommands.MoveUpByParagraph; break; case "MoveDownByPage": knownCommand = EditingCommands.MoveDownByPage; break; case "MoveUpByPage": knownCommand = EditingCommands.MoveUpByPage; break; case "MoveToLineStart": knownCommand = EditingCommands.MoveToLineStart; break; case "MoveToLineEnd": knownCommand = EditingCommands.MoveToLineEnd; break; case "MoveToDocumentStart": knownCommand = EditingCommands.MoveToDocumentStart; break; case "MoveToDocumentEnd": knownCommand = EditingCommands.MoveToDocumentEnd; break; case "SelectRightByCharacter": knownCommand = EditingCommands.SelectRightByCharacter; break; case "SelectLeftByCharacter": knownCommand = EditingCommands.SelectLeftByCharacter; break; case "SelectRightByWord": knownCommand = EditingCommands.SelectRightByWord; break; case "SelectLeftByWord": knownCommand = EditingCommands.SelectLeftByWord; break; case "SelectDownByLine": knownCommand = EditingCommands.SelectDownByLine; break; case "SelectUpByLine": knownCommand = EditingCommands.SelectUpByLine; break; case "SelectDownByParagraph": knownCommand = EditingCommands.SelectDownByParagraph; break; case "SelectUpByParagraph": knownCommand = EditingCommands.SelectUpByParagraph; break; case "SelectDownByPage": knownCommand = EditingCommands.SelectDownByPage; break; case "SelectUpByPage": knownCommand = EditingCommands.SelectUpByPage; break; case "SelectToLineStart": knownCommand = EditingCommands.SelectToLineStart; break; case "SelectToLineEnd": knownCommand = EditingCommands.SelectToLineEnd; break; case "SelectToDocumentStart": knownCommand = EditingCommands.SelectToDocumentStart; break; case "SelectToDocumentEnd": knownCommand = EditingCommands.SelectToDocumentEnd; break; case "ToggleBold": knownCommand = EditingCommands.ToggleBold; break; case "ToggleItalic": knownCommand = EditingCommands.ToggleItalic; break; case "ToggleUnderline": knownCommand = EditingCommands.ToggleUnderline; break; case "ToggleSubscript": knownCommand = EditingCommands.ToggleSubscript; break; case "ToggleSuperscript": knownCommand = EditingCommands.ToggleSuperscript; break; case "IncreaseFontSize": knownCommand = EditingCommands.IncreaseFontSize; break; case "DecreaseFontSize": knownCommand = EditingCommands.DecreaseFontSize; break; // BEGIN Application Compatibility Note // The following commands are internal, but they are exposed publicly // from our command converter. We cannot change this behavior // because it is well documented. For example, in the // "WPF XAML Vocabulary Specification 2006" found here: // http://msdn.microsoft.com/en-us/library/dd361848(PROT.10).aspx case "ApplyFontSize": knownCommand = EditingCommands.ApplyFontSize; break; case "ApplyFontFamily": knownCommand = EditingCommands.ApplyFontFamily; break; case "ApplyForeground": knownCommand = EditingCommands.ApplyForeground; break; case "ApplyBackground": knownCommand = EditingCommands.ApplyBackground; break; // END Application Compatibility Note case "AlignLeft": knownCommand = EditingCommands.AlignLeft; break; case "AlignCenter": knownCommand = EditingCommands.AlignCenter; break; case "AlignRight": knownCommand = EditingCommands.AlignRight; break; case "AlignJustify": knownCommand = EditingCommands.AlignJustify; break; case "ToggleBullets": knownCommand = EditingCommands.ToggleBullets; break; case "ToggleNumbering": knownCommand = EditingCommands.ToggleNumbering; break; case "IncreaseIndentation": knownCommand = EditingCommands.IncreaseIndentation; break; case "DecreaseIndentation": knownCommand = EditingCommands.DecreaseIndentation; break; case "CorrectSpellingError": knownCommand = EditingCommands.CorrectSpellingError; break; case "IgnoreSpellingError": knownCommand = EditingCommands.IgnoreSpellingError; break; } } if (ownerType == typeof(MediaCommands) || ((null == knownCommand) && searchAll)) { switch (localName) { case "Play": knownCommand = MediaCommands.Play; break; case "Pause": knownCommand = MediaCommands.Pause; break; case "Stop": knownCommand = MediaCommands.Stop; break; case "Record": knownCommand = MediaCommands.Record; break; case "NextTrack": knownCommand = MediaCommands.NextTrack; break; case "PreviousTrack": knownCommand = MediaCommands.PreviousTrack; break; case "FastForward": knownCommand = MediaCommands.FastForward; break; case "Rewind": knownCommand = MediaCommands.Rewind; break; case "ChannelUp": knownCommand = MediaCommands.ChannelUp; break; case "ChannelDown": knownCommand = MediaCommands.ChannelDown; break; case "TogglePlayPause": knownCommand = MediaCommands.TogglePlayPause; break; case "IncreaseVolume": knownCommand = MediaCommands.IncreaseVolume; break; case "DecreaseVolume": knownCommand = MediaCommands.DecreaseVolume; break; case "MuteVolume": knownCommand = MediaCommands.MuteVolume; break; case "IncreaseTreble": knownCommand = MediaCommands.IncreaseTreble; break; case "DecreaseTreble": knownCommand = MediaCommands.DecreaseTreble; break; case "IncreaseBass": knownCommand = MediaCommands.IncreaseBass; break; case "DecreaseBass": knownCommand = MediaCommands.DecreaseBass; break; case "BoostBass": knownCommand = MediaCommands.BoostBass; break; case "IncreaseMicrophoneVolume": knownCommand = MediaCommands.IncreaseMicrophoneVolume; break; case "DecreaseMicrophoneVolume": knownCommand = MediaCommands.DecreaseMicrophoneVolume; break; case "MuteMicrophoneVolume": knownCommand = MediaCommands.MuteMicrophoneVolume; break; case "ToggleMicrophoneOnOff": knownCommand = MediaCommands.ToggleMicrophoneOnOff; break; case "Select": knownCommand = MediaCommands.Select; break; } } #if DEBUG if (knownCommand == null) { if (ownerType != null) { VerifyCommandDoesntExist(ownerType, localName); } else { VerifyCommandDoesntExist(typeof(NavigationCommands), localName); VerifyCommandDoesntExist(typeof(ApplicationCommands), localName); VerifyCommandDoesntExist(typeof(MediaCommands), localName); VerifyCommandDoesntExist(typeof(EditingCommands), localName); VerifyCommandDoesntExist(typeof(ComponentCommands), localName); } } #endif return(knownCommand); }