Beispiel #1
0
        /// <summary>
        /// Private constructor that does the real work.
        /// </summary>
        /// <param name="key">Key</param>
        /// <param name="modifiers">Modifiers</param>
        /// <param name="displayString">display string</param>
        /// <param name="validateGesture">If true, throws an exception if the key and modifier are not valid</param>
        private KeyGesture(Key key, ModifierKeys modifiers, string displayString, bool validateGesture)
        {
            if (!ModifierKeysConverter.IsDefinedModifierKeys(modifiers))
            {
                throw new InvalidEnumArgumentException("modifiers", (int)modifiers, typeof(ModifierKeys));
            }

            if (!IsDefinedKey(key))
            {
                throw new InvalidEnumArgumentException("key", (int)key, typeof(Key));
            }

            if (displayString == null)
            {
                throw new ArgumentNullException("displayString");
            }

            if (validateGesture && !IsValid(key, modifiers))
            {
                throw new NotSupportedException(SR.Get(SRID.KeyGesture_Invalid, modifiers, key));
            }

            _modifiers     = modifiers;
            _key           = key;
            _displayString = displayString;
        }
        //Нажатия кнопок для HotKeys
        private void Settings_KeyDown(object sender, KeyEventArgs e)
        {
            string key = new System.Windows.Input.KeyConverter().ConvertToString(e.Key);
            string mod = new System.Windows.Input.ModifierKeysConverter().ConvertToString(System.Windows.Input.Keyboard.Modifiers);

            textbox_combination.Text = ((mod.Length > 0) ? mod + "+" : "") + key;

            e.Handled = true;
        }
Beispiel #3
0
        /// <summary>
        /// CanConvertToString()
        /// </summary>
        /// <param name="value"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        /// <ExternalAPI/>
        public override bool CanConvertToString(object value, IValueSerializerContext context)
        {
            KeyGesture keyGesture = value as KeyGesture;

            #pragma warning disable 6506
            return((keyGesture != null) &&
                   ModifierKeysConverter.IsDefinedModifierKeys(keyGesture.Modifiers) &&
                   KeyGestureConverter.IsDefinedKey(keyGesture.Key));

            #pragma warning restore 6506
        }
Beispiel #4
0
        private void InitializeHotKeys()
        {
            var kc = new SWF.KeysConverter();
            var mkc = new ModifierKeysConverter();

            _sshHotkey = new HotKey((ModifierKeys)mkc.ConvertFromString(_config.Hotkeys.Select.Modifiers), (SWF.Keys)kc.ConvertFromString(_config.Hotkeys.Select.Key));
            _sshHotkey.HotKeyPressed += k => ((MainWindow)this.MainWindow).ShowFullscreenWindow();

            Exit += (s, e) =>
            {
                _sshHotkey.Dispose();
            };
        }
        /// <summary>
        /// CanConvertToString()
        /// </summary>
        /// <param name="value"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        /// <ExternalAPI/>
        public override bool CanConvertToString(object value, IValueSerializerContext context)
        {
            bool         result       = false;
            MouseGesture mouseGesture = value as MouseGesture;

            if (mouseGesture != null)
            {
                if (ModifierKeysConverter.IsDefinedModifierKeys(mouseGesture.Modifiers) &&
                    MouseActionConverter.IsDefinedMouseAction(mouseGesture.MouseAction))
                {
                    result = true;
                }
            }

            return(result);
        }
Beispiel #6
0
        /// <summary>
        ///  Constructor
        /// </summary>
        /// <param name="mouseAction">Mouse Action</param>
        /// <param name="modifiers">Modifiers</param>
        public MouseGesture(MouseAction mouseAction, ModifierKeys modifiers)   // acclerator action
        {
            if (!MouseGesture.IsDefinedMouseAction(mouseAction))
            {
                throw new InvalidEnumArgumentException("mouseAction", (int)mouseAction, typeof(MouseAction));
            }

            if (!ModifierKeysConverter.IsDefinedModifierKeys(modifiers))
            {
                throw new InvalidEnumArgumentException("modifiers", (int)modifiers, typeof(ModifierKeys));
            }

            _modifiers   = modifiers;
            _mouseAction = mouseAction;

            //AttachClassListeners();
        }
Beispiel #7
0
 ///<summary>
 ///TypeConverter method override.
 ///</summary>
 ///<param name="context">ITypeDescriptorContext</param>
 ///<param name="destinationType">Type to convert to</param>
 ///<returns>true if conversion	is possible</returns>
 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
 {
     // We can convert to an InstanceDescriptor or to a string.
     if (destinationType == typeof(string))
     {
         // When invoked by the serialization engine we can convert to string only for known type
         if (context != null && context.Instance != null)
         {
             KeyGesture keyGesture = context.Instance as KeyGesture;
             if (keyGesture != null)
             {
                 return(ModifierKeysConverter.IsDefinedModifierKeys(keyGesture.Modifiers) &&
                        IsDefinedKey(keyGesture.Key));
             }
         }
     }
     return(false);
 }
Beispiel #8
0
        public static string HotKey2Str( Key key, ModifierKeys modifier )
        {
            if (!Enum.IsDefined(typeof(Key), key))
                throw new InvalidEnumArgumentException(nameof(key), (int) key, typeof(Key));
            try
            {
                ModifierKeysConverter mkc = new ModifierKeysConverter();
                var keyStr = Enum.GetName(typeof(Key), key);
                var modifierStr = mkc.ConvertToInvariantString(modifier);

                return $"{modifierStr}+{keyStr}";
            }
            catch (NotSupportedException)
            {
                // converter exception
                return null;
            }
        }
Beispiel #9
0
        private void WindowKeyDown(object sender, KeyEventArgs e)
        {
            if (numl.txt_box.IsFocused || numt.txt_box.IsFocused || numr.txt_box.IsFocused || numb.txt_box.IsFocused)
            {
                return;
            }
            string key         = new System.Windows.Input.KeyConverter().ConvertToString(e.Key);
            string mod         = new System.Windows.Input.ModifierKeysConverter().ConvertToString(System.Windows.Input.Keyboard.Modifiers);
            string PressedKeys = "=" + ((mod.Length > 0) ? mod + "+" : "") + key;

            string Action = HotKeys.GetAction(PressedKeys);

            e.Handled = (Action.Length > 0);

            switch (Action)
            {
            case ("Frame forward"): Frame_Shift(1); break;

            case ("Frame back"): Frame_Shift(-1); break;

            case ("10 frames forward"): Frame_Shift(10); break;

            case ("10 frames backward"): Frame_Shift(-10); break;

            case ("100 frames forward"): Frame_Shift(100); break;

            case ("100 frames backward"): Frame_Shift(-100); break;

            case ("30 sec. forward"): Frame_Shift(Convert.ToInt32(fps * 30)); break;

            case ("30 sec. backward"): Frame_Shift(-Convert.ToInt32(fps * 30)); break;

            case ("3 min. forward"): Frame_Shift(Convert.ToInt32(fps * 180)); break;

            case ("3 min. backward"): Frame_Shift(-Convert.ToInt32(fps * 180)); break;

            case ("Fullscreen"): button_fullscreen_Click(null, null); break;
            }
        }
Beispiel #10
0
        private void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = false;

            if (FileMenu.IsKeyboardFocusWithin || textbox_frame_goto.Visibility != Visibility.Hidden || textbox_start.IsFocused || textbox_end.IsFocused || script_box.IsFocused)
            {
                return;
            }
            else if (e.Key == Key.Delete && list_tasks.IsKeyboardFocusWithin)
            {
                RemoveSelectedTask();
                e.Handled = true;
                return;
            }

            string key = new System.Windows.Input.KeyConverter().ConvertToString(e.Key);
            string mod = new System.Windows.Input.ModifierKeysConverter().ConvertToString(System.Windows.Input.Keyboard.Modifiers);
            string Action = HotKeys.GetAction("=" + ((mod.Length > 0) ? mod + "+" : "") + key);
            if (Action.Length > 0)
            {
                e.Handled = true;
                switch (Action)
                {
                    //File
                    case ("Open file(s)"): OpenFile_Click(null, null); break;
                    case ("Open folder"): menu_open_folder_Click(null, null); break;
                    case ("Open DVD folder"): OpenDVD_Click(null, null); break;
                    case ("Decode file"): menu_decode_file_Click(null, null); break;
                    case ("Join file"): menu_join_Click(null, null); break;
                    case ("Close file"): button_close_Click(null, null); break;
                    case ("Save task"): button_save_Click(null, null); break;
                    case ("Save frame"): menu_save_frame_Click(null, null); break;
                    case ("Save THM frame"): menu_savethm_Click(null, null); break;
                    //Video
                    case ("Refresh preview"): mnUpdateVideo_Click(null, null); break;
                    case ("VDemux"): menu_demux_video_Click(null, null); break;
                    case ("Decoding"): mnDecoding_Click(mnVideoDecoding, null); break;
                    case ("Detect black borders"): menu_autocrop_Click(null, null); break;
                    case ("Detect interlace"): menu_detect_interlace_Click(null, null); break;
                    case ("Color correction"): ColorCorrection_Click(null, null); break;
                    case ("Resolution/Aspect"): AspectResolution_Click(null, null); break;
                    case ("Interlace/Framerate"): menu_interlace_Click(null, null); break;
                    case ("VEncoding settings"): VideoEncodingSettings_Click(null, null); break;
                    //Audio
                    case ("ADemux"): menu_demux_Click(null, null); break;
                    case ("Save to WAV"): menu_save_wav_Click(null, null); break;
                    case ("Editing options"): AudioOptions_Click(null, null); break;
                    case ("AEncoding settings"): AudioEncodingSettings_Click(null, null); break;
                    //Subtitles
                    case ("Add subtitles"): mnAddSubtitles_Click(null, null); break;
                    case ("Remove subtitles"): mnRemoveSubtitles_Click(null, null); break;
                    //AviSynth
                    case ("AvsP editor"): button_avsp_Click(null, null); break;
                    case ("Edit filtering script"): EditScript(null, null); break;
                    case ("Apply test script"): if (m != null) { ApplyTestScript(null, null); menu_createtestscript.IsChecked = m.testscript; }; break;
                    case ("Save script"): SaveScript(null, null); break;
                    case ("Run script"): menu_run_script_Click(null, null); break;
                    case ("MT settings"): menu_mt_settings_Click(null, null); break;
                    case ("Windows Media Player"): menu_play_in_Click(menu_playinwmp, null); break;
                    case ("Media Player Classic"): menu_play_in_Click(menu_playinmpc, null); break;
                    case ("WPF Video Player"): menu_play_in_Click(menu_playinwpf, null); break;
                    //Settings
                    case ("Global settings"): menu_settings_Click(null, null); break;
                    //Tools
                    case ("Media Info"): menu_info_media_Click(menu_info_media, null); break;
                    case ("FFRebuilder"): menu_ffrebuilder_Click(null, null); break;
                    case ("DGIndex"): mn_apps_Click(menu_dgindex, null); break;
                    case ("DGIndexNV"): mn_apps_Click(menu_dgindexnv, null); break;
                    case ("DGAVCIndex"): mn_apps_Click(menu_dgavcindex, null); break;
                    case ("VirtualDubMod"): mn_apps_Click(menu_virtualdubmod, null); break;
                    case ("AVI-Mux"): mn_apps_Click(menu_avimux, null); break;
                    case ("tsMuxeR"): mn_apps_Click(menu_tsmuxer, null); break;
                    case ("MKVExtract"): mn_apps_Click(menu_mkvextract, null); break;
                    case ("MKVMerge"): mn_apps_Click(menu_mkvmerge, null); break;
                    case ("Yamb"): mn_apps_Click(menu_yamb, null); break;
                    //Other
                    case ("Frame forward"): Frame_Shift(1); break;
                    case ("Frame back"): Frame_Shift(-1); break;
                    case ("10 frames forward"): Frame_Shift(10); break;
                    case ("10 frames backward"): Frame_Shift(-10); break;
                    case ("100 frames forward"): Frame_Shift(100); break;
                    case ("100 frames backward"): Frame_Shift(-100); break;
                    case ("30 sec. forward"): Frame_Shift(Convert.ToInt32(fps * 30)); break;
                    case ("30 sec. backward"): Frame_Shift(-Convert.ToInt32(fps * 30)); break;
                    case ("3 min. forward"): Frame_Shift(Convert.ToInt32(fps * 180)); break;
                    case ("3 min. backward"): Frame_Shift(-Convert.ToInt32(fps * 180)); break;
                    case ("Play-Pause"): PauseClip(); break;
                    case ("Fullscreen"): SwitchToFullScreen(); break;
                    case ("Volume+"): VolumePlus(); break;
                    case ("Volume-"): VolumeMinus(); break;
                    case ("Set Start"): button_set_trim_value_Click(button_set_start, null); break;
                    case ("Set End"): button_set_trim_value_Click(button_set_end, null); break;
                    case ("Next/New region"): button_trim_plus_Click(null, null); break;
                    case ("Previous region"): button_trim_minus_Click(null, null); break;
                    case ("Apply Trim"): button_apply_trim_Click(null, null); break;
                    case ("Add/Remove bookmark"): AddToBookmarks_Click(null, null); break;
                    case ("Edit format"): button_edit_format_Click(null, null); break;
                }
            }
        }
 public MultiKeyGestureConverter()
 {
     _keyConverter = new KeyConverter();
       _modifierKeysConverter = new ModifierKeysConverter();
 }
Beispiel #12
0
        private void InitlializeShortucts()
        {
            // shortcuts dictionary
            _shortcuts = new Dictionary<Tuple<Key, ModifierKeys>, Action>();

            // key converters
            var keyConverter = new KeyConverter();
            var modifiersKeyConverter = new ModifierKeysConverter();

            // open shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("O"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => Open());

            // save shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("S"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => Save());

            // export shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("E"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => Export());

            // undo shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("Z"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => _view.Undo());

            // redo shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("Y"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => _view.Redo());

            // snap shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("S"),
                    ModifierKeys.None),
                () => _view.ToggleSnap());

            // clear shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("Delete"),
                    (ModifierKeys)modifiersKeyConverter.ConvertFromString("Control")),
                () => _view.Clear());

            // editor shortcuts
            foreach (var editor in _view.Editors)
            {
                var _editor = editor;
                _shortcuts.Add(
                    new Tuple<Key, ModifierKeys>(
                        (Key)keyConverter.ConvertFromString(editor.Key),
                        editor.Modifiers == "" ? ModifierKeys.None : (ModifierKeys)modifiersKeyConverter.ConvertFromString(editor.Modifiers)),
                    () => _view.Enable(_editor));
            }

            // block shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("G"),
                    ModifierKeys.None),
                () => _view.CreateBlock());

            // delete shortcut
            _shortcuts.Add(
                new Tuple<Key, ModifierKeys>(
                    (Key)keyConverter.ConvertFromString("Delete"),
                    ModifierKeys.None),
                () => _view.Delete());
        }
Beispiel #13
0
        private void WindowKeyDown(object sender, KeyEventArgs e)
        {
            if (numl.txt_box.IsFocused || numt.txt_box.IsFocused || numr.txt_box.IsFocused || numb.txt_box.IsFocused) return;
            string key = new System.Windows.Input.KeyConverter().ConvertToString(e.Key);
            string mod = new System.Windows.Input.ModifierKeysConverter().ConvertToString(System.Windows.Input.Keyboard.Modifiers);
            string PressedKeys = "=" + ((mod.Length > 0) ? mod + "+" : "") + key;

            string Action = HotKeys.GetAction(PressedKeys);
            e.Handled = (Action.Length > 0);

            switch (Action)
            {
                case ("Frame forward"): Frame_Shift(1); break;
                case ("Frame back"): Frame_Shift(-1); break;
                case ("10 frames forward"): Frame_Shift(10); break;
                case ("10 frames backward"): Frame_Shift(-10); break;
                case ("100 frames forward"): Frame_Shift(100); break;
                case ("100 frames backward"): Frame_Shift(-100); break;
                case ("30 sec. forward"): Frame_Shift(Convert.ToInt32(fps * 30)); break;
                case ("30 sec. backward"): Frame_Shift(-Convert.ToInt32(fps * 30)); break;
                case ("3 min. forward"): Frame_Shift(Convert.ToInt32(fps * 180)); break;
                case ("3 min. backward"): Frame_Shift(-Convert.ToInt32(fps * 180)); break;
                case ("Fullscreen"): button_fullscreen_Click(null, null); break;
            }
        }
 protected virtual ModifierKeys ConvertFrom(string value) {
     ModifierKeysConverter c = new ModifierKeysConverter();
     return (ModifierKeys)c.ConvertFrom(value);
 }
 /// <summary>
 /// CanConvertToString()
 /// </summary>
 /// <param name="value"></param>
 /// <param name="context"></param>
 /// <returns></returns>
 /// <ExternalAPI/>
 public override bool CanConvertToString(object value, IValueSerializerContext context)
 {
     return((value is ModifierKeys) && ModifierKeysConverter.IsDefinedModifierKeys((ModifierKeys)value));
 }
        //Нажатия кнопок для HotKeys
        private void Settings_KeyDown(object sender, KeyEventArgs e)
        {
            string key = new System.Windows.Input.KeyConverter().ConvertToString(e.Key);
            string mod = new System.Windows.Input.ModifierKeysConverter().ConvertToString(System.Windows.Input.Keyboard.Modifiers);
            textbox_combination.Text = ((mod.Length > 0) ? mod + "+" : "") + key;

            e.Handled = true;
        }
Beispiel #17
0
        public static HotKey Str2HotKey(string s)
        {
            try
            {
                if (s.IsNullOrEmpty()) return null;
                int offset = s.LastIndexOf("+", StringComparison.OrdinalIgnoreCase);
                if (offset <= 0) return null;
                string modifierStr = s.Substring(0, offset).Trim();
                string keyStr = s.Substring(offset + 1).Trim();

                KeyConverter kc = new KeyConverter();
                ModifierKeysConverter mkc = new ModifierKeysConverter();
                Key key = (Key) kc.ConvertFrom(keyStr.ToUpper());
                ModifierKeys modifier = (ModifierKeys) mkc.ConvertFrom(modifierStr.ToUpper());

                return new HotKey(key, modifier);
            }
            catch (NotSupportedException)
            {
                // converter exception
                return null;
            }
            catch (NullReferenceException)
            {
                return null;
            }
        }
 protected virtual string ConvertTo(ModifierKeys value, Type type = null) {
     ModifierKeysConverter c = new ModifierKeysConverter();
     return (string)c.ConvertTo(value, type ?? typeof(string));
 }
		public ComplexInputGestureConverter()
		{
			_keyConverter = new KeyConverter();
			_modifierKeysConverter = new ModifierKeysConverter();
		}
 // Initialize known object types
 internal static TypeConverter CreateKnownTypeConverter(Int16 converterId)
 { 
     TypeConverter o = null;
     switch (converterId) 
     { 
         case -42: o = new System.Windows.Media.Converters.BoolIListConverter(); break;
         case -46: o = new System.ComponentModel.BooleanConverter(); break; 
         case -53: o = new System.Windows.Media.BrushConverter(); break;
         case -61: o = new System.ComponentModel.ByteConverter(); break;
         case -70: o = new System.ComponentModel.CharConverter(); break;
         case -71: o = new System.Windows.Media.Converters.CharIListConverter(); break; 
         case -87: o = new System.Windows.Media.ColorConverter(); break;
         case -94: o = new System.Windows.Input.CommandConverter(); break; 
         case -96: o = new System.Windows.Markup.ComponentResourceKeyConverter(); break; 
         case -111: o = new System.Windows.CornerRadiusConverter(); break;
         case -114: o = new System.ComponentModel.CultureInfoConverter(); break; 
         case -115: o = new System.Windows.CultureInfoIetfLanguageTagConverter(); break;
         case -117: o = new System.Windows.Input.CursorConverter(); break;
         case -124: o = new System.ComponentModel.DateTimeConverter(); break;
         case -125: o = new System.Windows.Markup.DateTimeConverter2(); break; 
         case -130: o = new System.ComponentModel.DecimalConverter(); break;
         case -137: o = new System.Windows.Markup.DependencyPropertyConverter(); break; 
         case -138: o = new System.Windows.DialogResultConverter(); break; 
         case -174: o = new System.Windows.Media.DoubleCollectionConverter(); break;
         case -175: o = new System.ComponentModel.DoubleConverter(); break; 
         case -176: o = new System.Windows.Media.Converters.DoubleIListConverter(); break;
         case -188: o = new System.Windows.DurationConverter(); break;
         case -190: o = new System.Windows.DynamicResourceExtensionConverter(); break;
         case -201: o = new System.Windows.ExpressionConverter(); break; 
         case -204: o = new System.Windows.FigureLengthConverter(); break;
         case -215: o = new System.Windows.Media.FontFamilyConverter(); break; 
         case -216: o = new System.Windows.FontSizeConverter(); break; 
         case -218: o = new System.Windows.FontStretchConverter(); break;
         case -220: o = new System.Windows.FontStyleConverter(); break; 
         case -222: o = new System.Windows.FontWeightConverter(); break;
         case -240: o = new System.Windows.Media.GeometryConverter(); break;
         case -256: o = new System.Windows.GridLengthConverter(); break;
         case -267: o = new System.ComponentModel.GuidConverter(); break; 
         case -286: o = new System.Windows.Media.ImageSourceConverter(); break;
         case -299: o = new System.Windows.Input.InputScopeConverter(); break; 
         case -301: o = new System.Windows.Input.InputScopeNameConverter(); break; 
         case -306: o = new System.ComponentModel.Int16Converter(); break;
         case -314: o = new System.Windows.Media.Int32CollectionConverter(); break; 
         case -315: o = new System.ComponentModel.Int32Converter(); break;
         case -319: o = new System.Windows.Int32RectConverter(); break;
         case -324: o = new System.ComponentModel.Int64Converter(); break;
         case -338: o = new System.Windows.Input.KeyConverter(); break; 
         case -340: o = new System.Windows.Input.KeyGestureConverter(); break;
         case -342: o = new System.Windows.KeySplineConverter(); break; 
         case -344: o = new System.Windows.KeyTimeConverter(); break; 
         case -348: o = new System.Windows.LengthConverter(); break;
         case -387: o = new System.Windows.Media.Media3D.Matrix3DConverter(); break; 
         case -392: o = new System.Windows.Media.MatrixConverter(); break;
         case -410: o = new System.Windows.Input.ModifierKeysConverter(); break;
         case -411: o = new System.Windows.Input.MouseActionConverter(); break;
         case -415: o = new System.Windows.Input.MouseGestureConverter(); break; 
         case -423: o = new System.Windows.NullableBoolConverter(); break;
         case -445: o = new System.Windows.Media.PathFigureCollectionConverter(); break; 
         case -453: o = new System.Windows.Media.PixelFormatConverter(); break; 
         case -462: o = new System.Windows.Media.Media3D.Point3DCollectionConverter(); break;
         case -463: o = new System.Windows.Media.Media3D.Point3DConverter(); break; 
         case -467: o = new System.Windows.Media.Media3D.Point4DConverter(); break;
         case -473: o = new System.Windows.Media.PointCollectionConverter(); break;
         case -474: o = new System.Windows.PointConverter(); break;
         case -475: o = new System.Windows.Media.Converters.PointIListConverter(); break; 
         case -492: o = new System.Windows.PropertyPathConverter(); break;
         case -498: o = new System.Windows.Media.Media3D.QuaternionConverter(); break; 
         case -507: o = new System.Windows.Media.Media3D.Rect3DConverter(); break; 
         case -511: o = new System.Windows.RectConverter(); break;
         case -521: o = new System.Windows.Media.Animation.RepeatBehaviorConverter(); break; 
         case -538: o = new System.Windows.Markup.RoutedEventConverter(); break;
         case -545: o = new System.ComponentModel.SByteConverter(); break;
         case -563: o = new System.ComponentModel.SingleConverter(); break;
         case -568: o = new System.Windows.Media.Media3D.Size3DConverter(); break; 
         case -572: o = new System.Windows.SizeConverter(); break;
         case -615: o = new System.ComponentModel.StringConverter(); break; 
         case -619: o = new System.Windows.StrokeCollectionConverter(); break; 
         case -633: o = new System.Windows.TemplateBindingExpressionConverter(); break;
         case -635: o = new System.Windows.TemplateBindingExtensionConverter(); break; 
         case -637: o = new System.Windows.Markup.TemplateKeyConverter(); break;
         case -645: o = new System.Windows.TextDecorationCollectionConverter(); break;
         case -655: o = new System.Windows.ThicknessConverter(); break;
         case -664: o = new System.ComponentModel.TimeSpanConverter(); break; 
         case -681: o = new System.Windows.Media.TransformConverter(); break;
         case -692: o = new System.Windows.Markup.TypeTypeConverter(); break; 
         case -696: o = new System.ComponentModel.UInt16Converter(); break; 
         case -698: o = new System.ComponentModel.UInt32Converter(); break;
         case -700: o = new System.ComponentModel.UInt64Converter(); break; 
         case -701: o = new System.Windows.Media.Converters.UShortIListConverter(); break;
         case -705: o = new System.UriTypeConverter(); break;
         case -714: o = new System.Windows.Media.Media3D.Vector3DCollectionConverter(); break;
         case -715: o = new System.Windows.Media.Media3D.Vector3DConverter(); break; 
         case -722: o = new System.Windows.Media.VectorCollectionConverter(); break;
         case -723: o = new System.Windows.VectorConverter(); break; 
         case -757: o = new System.Windows.Markup.XmlLanguageConverter(); break; 
     }
     return o; 
 }
Beispiel #21
0
        private void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = false;

            if (this.graphBuilder != null || IsFullScreen)
            {
                string key = new KeyConverter().ConvertToString(e.Key);
                string mod = new ModifierKeysConverter().ConvertToString(Keyboard.Modifiers);
                string Action = HotKeys.GetAction("=" + ((mod.Length > 0) ? mod + "+" : "") + key);
                if (Action.Length > 0)
                {
                    switch (Action)
                    {
                        case ("Play-Pause"): PauseClip(); e.Handled = true; break;
                        case ("Fullscreen"): SwitchToFullScreen(); e.Handled = true; break;
                    }
                }
            }
        }