ScreenToGif/Controls/KeyBox.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;

namespace ScreenToGif.Controls
{
    public class KeyBox : ContentControl
    {
        #region Dependency Properties

        public static readonly DependencyProperty ModifierKeysProperty = DependencyProperty.Register("ModifierKeys", typeof(ModifierKeys), typeof(KeyBox),
            new PropertyMetadata(ModifierKeys.None));

        public static readonly DependencyProperty MainKeyProperty = DependencyProperty.Register("MainKey", typeof(Key?), typeof(KeyBox), new PropertyMetadata(null));

        public static readonly DependencyProperty MaximumModifierCountProperty = DependencyProperty.Register("MaximumModifierCount", typeof(int), typeof(KeyBox),
            new PropertyMetadata(2));

        public static readonly DependencyProperty IsControlDownProperty = DependencyProperty.Register("IsControlDown", typeof(bool), typeof(KeyBox), new PropertyMetadata(false));

        public static readonly DependencyProperty IsShiftDownProperty = DependencyProperty.Register("IsShiftDown", typeof(bool), typeof(KeyBox), new PropertyMetadata(false));

        public static readonly DependencyProperty IsAltDownProperty = DependencyProperty.Register("IsAltDown", typeof(bool), typeof(KeyBox), new PropertyMetadata(false));

        #endregion

        #region Properties

        public ModifierKeys ModifierKeys
        {
            get { return (ModifierKeys)GetValue(ModifierKeysProperty); }
            set { SetValue(ModifierKeysProperty, value); }
        }

        public Key? MainKey
        {
            get { return (Key?)GetValue(MainKeyProperty); }
            set { SetValue(MainKeyProperty, value); }
        }

        public int MaximumModifierCount
        {
            get { return (int)GetValue(MaximumModifierCountProperty); }
            set { SetValue(MaximumModifierCountProperty, value); }
        }

        public bool IsControlDown
        {
            get { return (bool)GetValue(IsControlDownProperty); }
            set { SetValue(IsControlDownProperty, value); }
        }

        public bool IsShiftDown
        {
            get { return (bool)GetValue(IsShiftDownProperty); }
            set { SetValue(IsShiftDownProperty, value); }
        }

        public bool IsAltDown
后面还有 190 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。