Ejemplo n.º 1
0
 public static void SetRegexFilter(this ObjectListView listView, RegexFilterControl regexFilterControl, Func <object, string> typeNameGetter)
 {
     regexFilterControl.RegexApplied += (regex) => {
         listView.ModelFilter = new ModelFilter((o) =>
         {
             if (o == null)
             {
                 return(true);
             }
             var typeName = typeNameGetter(o);
             var b        = regex.IsMatch(typeName);
             return(b);
         });
         listView.UseFiltering = true;
     };
     regexFilterControl.RegexCancelled += () => listView.UseFiltering = false;
 }
Ejemplo n.º 2
0
 public static void SetTypeNameFilter <T>(this ObjectListView listView, RegexFilterControl regexFilterControl) where T : ITypeNameData
 {
     SetRegexFilter(listView, regexFilterControl, o => ((T)o).TypeName);
 }