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()); }
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; } }
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; } }
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; }
public bool IsRepeatedBy(KeyPress nextKeyPress) { return(textParts.SequenceEqual(nextKeyPress.GetTextParts())); }
static IEnumerable <string> CreateTextSequence(KeyPress key) { return(CreateTextSequence(new[] { key })); }
public bool IsRepeatedBy(KeyPress nextKeyPress) { return textParts.SequenceEqual(nextKeyPress.GetTextParts()); }
public RepeatedKeyPress(KeyPress keyPress, bool requiresPrefix = false) { nextRequiresSeperator = keyPress.HasModifierPressed; textParts = keyPress.GetTextParts().ToArray(); this.requiresPrefix = requiresPrefix; repeatCount = 1; }
static IEnumerable<string> CreateTextSequence(KeyPress key) { return CreateTextSequence(new[] {key}); }
bool Equals(KeyPress other) { return base.Equals(other) && Equals(Process, other.Process) && Equals(InterceptKeyEventArgs, other.InterceptKeyEventArgs) && Input.SequenceEqual(other.Input); }
public Message(KeyPress key) : this() { ProcessName = key.Process.ProcessName; AddKey(key); CanBeMerged = !key.HasModifierPressed; }