public IQueryable GetQueryable(IEverything everything)
 {
     return(everything
            .Search()
            .Name
            .Contains(this.Pattern));
 }
Example #2
0
        public static IEverything Between(this IEverything everything, int min, int max, Enum unit)
        {
            string u = unit.ToString().ToLower();

            everything.SearchText += $"{min}{u}-{max}{u}";

            return(everything);
        }
 public MainViewModel()
 {
     everything      = new Everything();
     QueryCategories =
         new ObservableCollection <IQueryViewModel> {
         new NameViewModel(), new DateViewModel(), new SizeViewModel()
     };
     Results = new ObservableCollection <ISearchResult>();
     BindingOperations.EnableCollectionSynchronization(Results, collectionLock);
     SearchCommand = new RelayCommand(SearchExecute);
 }
Example #4
0
        public IQueryable GetQueryable(IEverything everything)
        {
            if (this.From.HasValue && this.To.HasValue)
            {
                return(everything
                       .Search()
                       .ModificationDate
                       .Between(this.From.Value, this.To.Value));
            }
            else if (this.From.HasValue)
            {
                return(everything
                       .Search()
                       .ModificationDate
                       .Equal(this.From.Value));
            }

            return(null);
        }
Example #5
0
 public static IEverything This(this IEverything everything, Times times)
 {
     return(Date(everything, $"this{times.ToString().ToLower()}"));
 }
Example #6
0
        public static IEverything Not(this IEverything everything)
        {
            everything.SearchText += "!";

            return(everything);
        }
Example #7
0
        public static IEverything Between(this IEverything everything, int min, int max, string unit = "")
        {
            everything.SearchText += $"{min}{unit}-{max}{unit}";

            return(everything);
        }
Example #8
0
 public static IEverything This(this IEverything everything, Dates date)
 {
     return(Date(everything, $"this{date.ToString().ToLower()}"));
 }
Example #9
0
        public static IEverything And(this IEverything everything)
        {
            everything.SearchText += " ";

            return(everything);
        }
Example #10
0
 public static IEverything Next(this IEverything everything, Times times, int num = 0)
 {
     return(Date(everything, "next", times, num, string.Empty));
 }
Example #11
0
        private static IEverything Macro(IEverything everything, string tag, string search)
        {
            everything.SearchText += tag + LogicSearch.QuoteIfNeeded(search);

            return(everything);
        }
Example #12
0
 public IQueryable GetQueryable(IEverything everything)
 {
     return(everything.Search()
            .Size
            .Equal(this.PredefinedSize));
 }
Example #13
0
 public static IEverything Video(this IEverything everything, string search = null)
 {
     return(Macro(everything, "video:", search));
 }
Example #14
0
 public static IEverything Title(this IEverything everything, string title = null)
 {
     return(Search(everything, "title:", title));
 }
Example #15
0
 public static IEverything Track(this IEverything everything, int track = -1)
 {
     return(Search(everything, "track:", track >= 0 ? $"{track}" : String.Empty));
 }
Example #16
0
 public static IEverything Genre(this IEverything everything, string genre = null)
 {
     return(Search(everything, "genre:", genre));
 }
Example #17
0
 public static IEverything Artist(this IEverything everything, string artist = null)
 {
     return(Search(everything, "artist:", artist));
 }
Example #18
0
 public static IEverything Last(this IEverything everything, Times times, int num = 0)
 {
     return(Date(everything, "last", times, num, String.Empty));
 }
Example #19
0
        public static IEverything Is(this IEverything everything, string value)
        {
            everything.SearchText += QuoteIfNeeded(value);

            return(everything);
        }
Example #20
0
 public static IEverything Exe(this IEverything everything, string search = null)
 {
     return(Macro(everything, "exe:", search));
 }
Example #21
0
 public static IEverything Comment(this IEverything everything, string comment = null)
 {
     return(Search(everything, "comment:", comment));
 }
Example #22
0
 public static IEverything Next(this IEverything everything, Dates date, int num = 0)
 {
     return(Date(everything, "next", date, num, "s"));
 }
Example #23
0
 public static IEverything Zip(this IEverything everything, string search = null)
 {
     return(Macro(everything, "zip:", search));
 }
Example #24
0
 public static IEverything Album(this IEverything everything, string album = null)
 {
     return(Search(everything, "album:", album));
 }
Example #25
0
 public static IEverything Picture(this IEverything everything, string search = null)
 {
     return(Macro(everything, "pic:", search));
 }
Example #26
0
        public static IEverything Is(this IEverything everything, object value)
        {
            everything.SearchText += QuoteIfNeeded(value.ToString());

            return(everything);
        }
Example #27
0
 public static IEverything Document(this IEverything everything, string search = null)
 {
     return(Macro(everything, "doc:", search));
 }
Example #28
0
        public static IEverything GreaterThan(this IEverything everything, int value)
        {
            everything.SearchText += $">{value}";

            return(everything);
        }
Example #29
0
 public static IEverything Audio(this IEverything everything, string search = null)
 {
     return(Macro(everything, "audio:", search));
 }
Example #30
0
        public static IEverything LessOrEqualThan(this IEverything everything, int value)
        {
            everything.SearchText += $"<={value}";

            return(everything);
        }