// This code is distributed under MIT license. // Copyright (c) 2010-2018 George Mamaladze // See license.txt or https://mit-license.org/ using System.Linq; namespace Gma.System.MouseKeyHook { /// /// Describes key or key combination sequences. e.g. Control+Z,Z /// public class Sequence : SequenceBase { private Sequence(Combination[] combinations) : base(combinations) { } /// /// Creates an instance of sequence object from parameters representing keys or key combinations. /// /// /// public static Sequence Of(params Combination[] combinations) { return new Sequence(combinations); } /// /// Creates an instance of sequnce object from string. /// The string must contain comma ',' delimited list of strings describing keys or key combinations. /// Examples: 'A,B,C' 'Alt+R,S', 'Shift+R,Alt+K' /// /// /// public static Sequence FromString(string text) { var parts = text.Split(','); var combinations = parts.Select(Combination.FromString).ToArray(); return new Sequence(combinations); } } }