Esempio n. 1
0
        internal static InputGestureCollection LoadDefaultGestureFromResource(byte commandId)
        {
            InputGestureCollection gestures = new InputGestureCollection();

            //Standard Commands
            switch ((CommandId)commandId)
            {
            case  CommandId.BrowseBack:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.BrowseBackKey),
                    SR.Get(SRID.BrowseBackKeyDisplayString),
                    gestures);
                break;

            case  CommandId.BrowseForward:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.BrowseForwardKey),
                    SR.Get(SRID.BrowseForwardKeyDisplayString),
                    gestures);
                break;

            case  CommandId.BrowseHome:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.BrowseHomeKey),
                    SR.Get(SRID.BrowseHomeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.BrowseStop:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.BrowseStopKey),
                    SR.Get(SRID.BrowseStopKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Refresh:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.RefreshKey),
                    SR.Get(SRID.RefreshKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Favorites:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.FavoritesKey),
                    SR.Get(SRID.FavoritesKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Search:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.SearchKey),
                    SR.Get(SRID.SearchKeyDisplayString),
                    gestures);
                break;

            case  CommandId.IncreaseZoom:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.IncreaseZoomKey),
                    SR.Get(SRID.IncreaseZoomKeyDisplayString),
                    gestures);
                break;

            case  CommandId.DecreaseZoom:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.DecreaseZoomKey),
                    SR.Get(SRID.DecreaseZoomKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Zoom:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.ZoomKey),
                    SR.Get(SRID.ZoomKeyDisplayString),
                    gestures);
                break;

            case  CommandId.NextPage:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.NextPageKey),
                    SR.Get(SRID.NextPageKeyDisplayString),
                    gestures);
                break;

            case  CommandId.PreviousPage:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.PreviousPageKey),
                    SR.Get(SRID.PreviousPageKeyDisplayString),
                    gestures);
                break;

            case  CommandId.FirstPage:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.FirstPageKey),
                    SR.Get(SRID.FirstPageKeyDisplayString),
                    gestures);
                break;

            case  CommandId.LastPage:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.LastPageKey),
                    SR.Get(SRID.LastPageKeyDisplayString),
                    gestures);
                break;

            case  CommandId.GoToPage:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.GoToPageKey),
                    SR.Get(SRID.GoToPageKeyDisplayString),
                    gestures);
                break;

            case  CommandId.NavigateJournal:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.NavigateJournalKey),
                    SR.Get(SRID.NavigateJournalKeyDisplayString),
                    gestures);
                break;
            }
            return(gestures);
        }
Esempio n. 2
0
        internal static InputGestureCollection LoadDefaultGestureFromResource(byte commandId)
        {
            InputGestureCollection gestures = new InputGestureCollection();

            //Standard Commands
            switch ((CommandId)commandId)
            {
            case  CommandId.Cut:
                KeyGesture.AddGesturesFromResourceStrings(
                    CutKey,
                    SR.Get(SRID.CutKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Copy:
                KeyGesture.AddGesturesFromResourceStrings(
                    CopyKey,
                    SR.Get(SRID.CopyKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Paste:
                KeyGesture.AddGesturesFromResourceStrings(
                    PasteKey,
                    SR.Get(SRID.PasteKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Undo:
                KeyGesture.AddGesturesFromResourceStrings(
                    UndoKey,
                    SR.Get(SRID.UndoKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Redo:
                KeyGesture.AddGesturesFromResourceStrings(
                    RedoKey,
                    SR.Get(SRID.RedoKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Delete:
                KeyGesture.AddGesturesFromResourceStrings(
                    DeleteKey,
                    SR.Get(SRID.DeleteKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Find:
                KeyGesture.AddGesturesFromResourceStrings(
                    FindKey,
                    SR.Get(SRID.FindKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Replace:
                KeyGesture.AddGesturesFromResourceStrings(
                    ReplaceKey,
                    SR.Get(SRID.ReplaceKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SelectAll:
                KeyGesture.AddGesturesFromResourceStrings(
                    SelectAllKey,
                    SR.Get(SRID.SelectAllKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Help:
                KeyGesture.AddGesturesFromResourceStrings(
                    HelpKey,
                    SR.Get(SRID.HelpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.New:
                KeyGesture.AddGesturesFromResourceStrings(
                    NewKey,
                    SR.Get(SRID.NewKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Open:
                KeyGesture.AddGesturesFromResourceStrings(
                    OpenKey,
                    SR.Get(SRID.OpenKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Save:
                KeyGesture.AddGesturesFromResourceStrings(
                    SaveKey,
                    SR.Get(SRID.SaveKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SaveAs:
                break;     // there are no default bindings for  CommandId.SaveAs

            case  CommandId.Print:
                KeyGesture.AddGesturesFromResourceStrings(
                    PrintKey,
                    SR.Get(SRID.PrintKeyDisplayString),
                    gestures);
                break;

            case  CommandId.CancelPrint:
                break;     // there are no default bindings for  CommandId.CancelPrint

            case  CommandId.PrintPreview:
                KeyGesture.AddGesturesFromResourceStrings(
                    PrintPreviewKey,
                    SR.Get(SRID.PrintPreviewKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Close:
                break;     // there are no default bindings for  CommandId.Close

            case  CommandId.ContextMenu:
                KeyGesture.AddGesturesFromResourceStrings(
                    ContextMenuKey,
                    SR.Get(SRID.ContextMenuKeyDisplayString),
                    gestures);
                break;

            case  CommandId.CorrectionList:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.CorrectionListKey),
                    SR.Get(SRID.CorrectionListKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Properties:
                KeyGesture.AddGesturesFromResourceStrings(
                    PropertiesKey,
                    SR.Get(SRID.PropertiesKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Stop:
                KeyGesture.AddGesturesFromResourceStrings(
                    StopKey,
                    SR.Get(SRID.StopKeyDisplayString),
                    gestures);
                break;

            case  CommandId.NotACommand:
                break;     // there are no default bindings for  CommandId.NotACommand
            }
            return(gestures);
        }
Esempio n. 3
0
        internal static InputGestureCollection LoadDefaultGestureFromResource(byte commandId)
        {
            InputGestureCollection gestures = new InputGestureCollection();

            //Standard Commands
            switch ((CommandId)commandId)
            {
            case  CommandId.ScrollPageUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    ScrollPageUpKey,
                    SR.Get(SRID.ScrollPageUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ScrollPageDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    ScrollPageDownKey,
                    SR.Get(SRID.ScrollPageDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ScrollPageLeft:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.ScrollPageLeftKey),
                    SR.Get(SRID.ScrollPageLeftKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ScrollPageRight:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.ScrollPageRightKey),
                    SR.Get(SRID.ScrollPageRightKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ScrollByLine:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.ScrollByLineKey),
                    SR.Get(SRID.ScrollByLineKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveLeft:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveLeftKey,
                    SR.Get(SRID.MoveLeftKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveRight:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveRightKey,
                    SR.Get(SRID.MoveRightKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveUpKey,
                    SR.Get(SRID.MoveUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveDownKey,
                    SR.Get(SRID.MoveDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ExtendSelectionUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    ExtendSelectionUpKey,
                    SR.Get(SRID.ExtendSelectionUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ExtendSelectionDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    ExtendSelectionDownKey,
                    SR.Get(SRID.ExtendSelectionDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ExtendSelectionLeft:
                KeyGesture.AddGesturesFromResourceStrings(
                    ExtendSelectionLeftKey,
                    SR.Get(SRID.ExtendSelectionLeftKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ExtendSelectionRight:
                KeyGesture.AddGesturesFromResourceStrings(
                    ExtendSelectionRightKey,
                    SR.Get(SRID.ExtendSelectionRightKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveToHome:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveToHomeKey,
                    SR.Get(SRID.MoveToHomeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveToEnd:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveToEndKey,
                    SR.Get(SRID.MoveToEndKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveToPageUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveToPageUpKey,
                    SR.Get(SRID.MoveToPageUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveToPageDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveToPageDownKey,
                    SR.Get(SRID.MoveToPageDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SelectToHome:
                KeyGesture.AddGesturesFromResourceStrings(
                    SelectToHomeKey,
                    SR.Get(SRID.SelectToHomeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SelectToEnd:
                KeyGesture.AddGesturesFromResourceStrings(
                    SelectToEndKey,
                    SR.Get(SRID.SelectToEndKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SelectToPageDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    SelectToPageDownKey,
                    SR.Get(SRID.SelectToPageDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.SelectToPageUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    SelectToPageUpKey,
                    SR.Get(SRID.SelectToPageUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusUpKey,
                    SR.Get(SRID.MoveFocusUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusDownKey,
                    SR.Get(SRID.MoveFocusDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusBack:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusBackKey,
                    SR.Get(SRID.MoveFocusBackKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusForward:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusForwardKey,
                    SR.Get(SRID.MoveFocusForwardKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusPageUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusPageUpKey,
                    SR.Get(SRID.MoveFocusPageUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MoveFocusPageDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    MoveFocusPageDownKey,
                    SR.Get(SRID.MoveFocusPageDownKeyDisplayString),
                    gestures);
                break;
            }
            return(gestures);
        }
Esempio n. 4
0
        internal static InputGestureCollection LoadDefaultGestureFromResource(byte commandId)
        {
            InputGestureCollection gestures = new InputGestureCollection();

            //Standard Commands
            switch ((CommandId)commandId)
            {
            case  CommandId.Play:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaPlayKey),
                    SR.Get(SRID.MediaPlayKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Pause:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaPauseKey),
                    SR.Get(SRID.MediaPauseKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Stop:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaStopKey),
                    SR.Get(SRID.MediaStopKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Record:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaRecordKey),
                    SR.Get(SRID.MediaRecordKeyDisplayString),
                    gestures);
                break;

            case  CommandId.NextTrack:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaNextTrackKey),
                    SR.Get(SRID.MediaNextTrackKeyDisplayString),
                    gestures);
                break;

            case  CommandId.PreviousTrack:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaPreviousTrackKey),
                    SR.Get(SRID.MediaPreviousTrackKeyDisplayString),
                    gestures);
                break;

            case  CommandId.FastForward:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaFastForwardKey),
                    SR.Get(SRID.MediaFastForwardKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Rewind:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaRewindKey),
                    SR.Get(SRID.MediaRewindKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ChannelUp:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaChannelUpKey),
                    SR.Get(SRID.MediaChannelUpKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ChannelDown:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaChannelDownKey),
                    SR.Get(SRID.MediaChannelDownKeyDisplayString),
                    gestures);
                break;

            case  CommandId.TogglePlayPause:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaTogglePlayPauseKey),
                    SR.Get(SRID.MediaTogglePlayPauseKeyDisplayString),
                    gestures);
                break;

            case  CommandId.IncreaseVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaIncreaseVolumeKey),
                    SR.Get(SRID.MediaIncreaseVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.DecreaseVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaDecreaseVolumeKey),
                    SR.Get(SRID.MediaDecreaseVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MuteVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaMuteVolumeKey),
                    SR.Get(SRID.MediaMuteVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.IncreaseTreble:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaIncreaseTrebleKey),
                    SR.Get(SRID.MediaIncreaseTrebleKeyDisplayString),
                    gestures);
                break;

            case  CommandId.DecreaseTreble:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaDecreaseTrebleKey),
                    SR.Get(SRID.MediaDecreaseTrebleKeyDisplayString),
                    gestures);
                break;

            case  CommandId.IncreaseBass:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaIncreaseBassKey),
                    SR.Get(SRID.MediaIncreaseBassKeyDisplayString),
                    gestures);
                break;

            case  CommandId.DecreaseBass:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaDecreaseBassKey),
                    SR.Get(SRID.MediaDecreaseBassKeyDisplayString),
                    gestures);
                break;

            case  CommandId.BoostBass:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaBoostBassKey),
                    SR.Get(SRID.MediaBoostBassKeyDisplayString),
                    gestures);
                break;

            case  CommandId.IncreaseMicrophoneVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaIncreaseMicrophoneVolumeKey),
                    SR.Get(SRID.MediaIncreaseMicrophoneVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.DecreaseMicrophoneVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaDecreaseMicrophoneVolumeKey),
                    SR.Get(SRID.MediaDecreaseMicrophoneVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.MuteMicrophoneVolume:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaMuteMicrophoneVolumeKey),
                    SR.Get(SRID.MediaMuteMicrophoneVolumeKeyDisplayString),
                    gestures);
                break;

            case  CommandId.ToggleMicrophoneOnOff:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaToggleMicrophoneOnOffKey),
                    SR.Get(SRID.MediaToggleMicrophoneOnOffKeyDisplayString),
                    gestures);
                break;

            case  CommandId.Select:
                KeyGesture.AddGesturesFromResourceStrings(
                    SR.Get(SRID.MediaSelectKey),
                    SR.Get(SRID.MediaSelectKeyDisplayString),
                    gestures);
                break;
            }
            return(gestures);
        }