Example #1
0
 public CustomTerminal(string name, MatchHandler handler, params string[] prefixes) : base(name)
 {
     _handler = handler;
     if (prefixes != null)
     {
         Prefixes.AddRange(prefixes);
     }
 }
Example #2
0
 public RegexBasedTerminal(string name, string pattern, params string[] prefixes) : base(name)
 {
     Pattern = pattern;
     if (prefixes != null)
     {
         Prefixes.AddRange(prefixes);
     }
 }
Example #3
0
 // Mono's C# compiler prefers this overload, which is incorrect. Marking it `private` to
 // to work around.
 //
 // See https://github.com/Pash-Project/Pash/issues/24
 //
 // See https://github.com/Pash-Project/Pash/issues/29
 //
 // See https://bugzilla.xamarin.com/show_bug.cgi?id=6541
 private RegexBasedTerminal(string pattern, params string[] prefixes)
     : base("name")
 {
     Pattern = pattern;
     if (prefixes != null)
     {
         Prefixes.AddRange(prefixes);
     }
 }
Example #4
0
 public CustomTerminal(string name, MatchHandler handler, params string[] prefixes) : base(name)
 {
     _handler = handler;
     if (prefixes != null)
     {
         Prefixes.AddRange(prefixes);
     }
     this.EditorInfo = new TokenEditorInfo(TokenType.Unknown, TokenColor.Text, TokenTriggers.None);
 }
Example #5
0
        protected void Init(string cachekey, int?cachetime, string[] perfixes)
        {
            Key        = cachekey;
            _keyFormat = cachekey;
            if (cachetime.HasValue)
            {
                CacheTime = cachetime.Value;
            }

            Prefixes.AddRange(perfixes.Where(perfix => string.IsNullOrEmpty(perfix)));
        }
Example #6
0
        /// <summary>
        /// Init instance of CacheKey
        /// </summary>
        /// <param name="cacheKey">Cache key</param>
        /// <param name="cacheTime">Cache time; set to null to use the default value</param>
        /// <param name="prefixes">Prefixes to remove by prefix functionality</param>
        protected void Init(string cacheKey, int?cacheTime = null, params string[] prefixes)
        {
            Key = cacheKey;

            _keyFormat = cacheKey;

            if (cacheTime.HasValue)
            {
                CacheTime = cacheTime.Value;
            }

            Prefixes.AddRange(prefixes.Where(prefix => !string.IsNullOrEmpty(prefix)));
        }
Example #7
0
 /// <summary>
 /// Initialize a new instance with key and prefixes
 /// </summary>
 /// <param name="key">Key</param>
 /// <param name="prefixes">Prefixes for remove by prefix functionality</param>
 public CacheKey(string key, params string[] prefixes)
 {
     Key = key;
     Prefixes.AddRange(prefixes.Where(prefix => !string.IsNullOrEmpty(prefix)));
 }