示例#1
0
 // effects: associates the filter creator function with name
 //      replaces the existing creator if one exists
 public void RegisterFilter(string name, Filter.CreateFn fn)
 {
     if (_filters.ContainsKey(name))
     {
         throw new Exception($"{name} already registered");
     }
     _filters[name] = fn;
 }
示例#2
0
 // effects: associates the filter creator function with name
 //   replaces the existing creator if one exists
 public void RegisterFilter(string name, Filter.CreateFn fn)
 {
     if (_filters.ContainsKey(name) == true)
     {
         _filters[name] = fn;
     }
     else
     {
         _filters.Add(name, fn);
     }
 }
示例#3
0
 // Wrapper function for FilterFactory.RegisterFilter
 public void RegisterFilter(string name, Filter.CreateFn fn)
 {
     _filters.RegisterFilter(name, fn);
 }