bool HasConditions(HotstringDefinition hotstring) { string history = this.history.ToString(); if (history.Length == 0) { return(false); } var compare = (hotstring.EnabledOptions & HotstringDefinition.Options.CaseSensitive) == HotstringDefinition.Options.CaseSensitive ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase; int x = history.Length - hotstring.Sequence.Length - 1; if ((hotstring.EnabledOptions & HotstringDefinition.Options.AutoTrigger) == HotstringDefinition.Options.AutoTrigger) { if (!history.EndsWith(hotstring.Sequence, compare)) { return(false); } } else { if (history.Length < hotstring.Sequence.Length + 1) { return(false); } if (hotstring.EndChars.IndexOf(history[history.Length - 1]) == -1) { return(false); } if (!history.Substring(x--, hotstring.Sequence.Length).Equals(hotstring.Sequence, compare)) { return(false); } } if ((hotstring.EnabledOptions & HotstringDefinition.Options.Nested) != HotstringDefinition.Options.Nested) { if (x > -1 && char.IsLetterOrDigit(history[x])) { return(false); } } return(true); }
public void Remove(HotstringDefinition hotstring) { hotstrings.Remove(hotstring); }
public HotstringDefinition Add(HotstringDefinition hotstring) { hotstrings.Add(hotstring); return hotstring; }
bool HasConditions(HotstringDefinition hotstring) { string history = this.history.ToString(); if (history.Length == 0) return false; var compare = (hotstring.EnabledOptions & HotstringDefinition.Options.CaseSensitive) == HotstringDefinition.Options.CaseSensitive ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase; int x = history.Length - hotstring.Sequence.Length - 1; if ((hotstring.EnabledOptions & HotstringDefinition.Options.AutoTrigger) == HotstringDefinition.Options.AutoTrigger) { if (!history.EndsWith(hotstring.Sequence, compare)) return false; } else { if (history.Length < hotstring.Sequence.Length + 1) return false; if (hotstring.EndChars.IndexOf(history[history.Length - 1]) == -1) return false; if (!history.Substring(x--, hotstring.Sequence.Length).Equals(hotstring.Sequence, compare)) return false; } if ((hotstring.EnabledOptions & HotstringDefinition.Options.Nested) != HotstringDefinition.Options.Nested) if (x > -1 && char.IsLetterOrDigit(history[x])) return false; return true; }
public HotstringDefinition Add(HotstringDefinition hotstring) { hotstrings.Add(hotstring); return(hotstring); }