Exemple #1
0
 public override bool Equals(object o)
 {
     if (o == null || !(o is FactoryCache.Key))
     {
         return(false);
     }
     FactoryCache.Key key = (FactoryCache.Key)o;
     return(this.options == key.options && this.pattern.Equals(key.pattern));
 }
Exemple #2
0
 public void Add(string pattern, RegexOptions options, IMachineFactory factory)
 {
     lock (this)
     {
         FactoryCache.Key key = new FactoryCache.Key(pattern, options);
         this.Cleanup();
         this.factories[key] = factory;
         this.mru_list.Use(key);
     }
 }
Exemple #3
0
 public IMachineFactory Lookup(string pattern, RegexOptions options)
 {
     lock (this)
     {
         FactoryCache.Key key = new FactoryCache.Key(pattern, options);
         if (this.factories.Contains(key))
         {
             this.mru_list.Use(key);
             return((IMachineFactory)this.factories[key]);
         }
     }
     return(null);
 }