示例#1
0
文件: Message.cs 项目: bihai/carnac
        public Message(KeyPress key)
            : this()
        {
            processName = key.Process.ProcessName;
            processIcon = key.Process.ProcessIcon;
            canBeMerged = !key.HasModifierPressed;

            keys = new ReadOnlyCollection<KeyPress>(new[] { key });
            textCollection = new ReadOnlyCollection<string>(CreateTextSequence(key).ToArray());
        }
示例#2
0
 public void AddKey(KeyPress keyPress)
 {
     keyCollection.Add(keyPress);
     if (lastKeyPress != null && lastKeyPress.IsShortcut)
         textCollection.Add(", ");
     lastKeyPress = keyPress;
     var first = true;
     foreach (var text in keyPress.Input)
     {
         if (!first)
             AddText(" + ");
         AddText(text);
         first = false;
     }
 }
示例#3
0
        public void AddKey(KeyPress keyPress)
        {
            keyCollection.Add(keyPress);
            if (lastKeyPress != null && lastKeyPress.IsShortcut)
            {
                textCollection.Add(", ");
            }
            lastKeyPress = keyPress;
            var first = true;

            foreach (var text in keyPress.Input)
            {
                if (!first)
                {
                    AddText(" + ");
                }
                AddText(text);
                first = false;
            }
        }
示例#4
0
文件: Message.cs 项目: phaufe/carnac
        void AddKey(KeyPress keyPress)
        {
            keyCollection.Add(keyPress);
            if (lastKeyPress != null && lastKeyPress.HasModifierPressed)
            {
                textCollection.Add(", ");
            }
            lastKeyPress = keyPress;
            var first = true;

            foreach (var text in keyPress.Input)
            {
                if (!first)
                {
                    AddText(" + ");
                }
                AddText(text);
                first = false;
            }
            Count++;
            LastMessage = DateTime.Now;
        }
示例#5
0
 public bool IsRepeatedBy(KeyPress nextKeyPress)
 {
     return(textParts.SequenceEqual(nextKeyPress.GetTextParts()));
 }
示例#6
0
 static IEnumerable <string> CreateTextSequence(KeyPress key)
 {
     return(CreateTextSequence(new[] { key }));
 }
示例#7
0
文件: Message.cs 项目: bihai/carnac
 public bool IsRepeatedBy(KeyPress nextKeyPress)
 {
     return textParts.SequenceEqual(nextKeyPress.GetTextParts());
 }
示例#8
0
文件: Message.cs 项目: bihai/carnac
 public RepeatedKeyPress(KeyPress keyPress, bool requiresPrefix = false)
 {
     nextRequiresSeperator = keyPress.HasModifierPressed;
     textParts = keyPress.GetTextParts().ToArray();
     this.requiresPrefix = requiresPrefix;
     repeatCount = 1;
 }
示例#9
0
文件: Message.cs 项目: bihai/carnac
 static IEnumerable<string> CreateTextSequence(KeyPress key)
 {
     return CreateTextSequence(new[] {key});
 }
示例#10
0
文件: KeyPress.cs 项目: bihai/carnac
 bool Equals(KeyPress other)
 {
     return base.Equals(other)
         && Equals(Process, other.Process)
         && Equals(InterceptKeyEventArgs, other.InterceptKeyEventArgs)
         && Input.SequenceEqual(other.Input);
 }
示例#11
0
文件: Message.cs 项目: phaufe/carnac
 public Message(KeyPress key) : this()
 {
     ProcessName = key.Process.ProcessName;
     AddKey(key);
     CanBeMerged = !key.HasModifierPressed;
 }