Exemplo n.º 1
0
 public IQueryable GetQueryable(IEverything everything)
 {
     return(everything
            .Search()
            .Name
            .Contains(this.Pattern));
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public static IEverything This(this IEverything everything, Times times)
 {
     return(Date(everything, $"this{times.ToString().ToLower()}"));
 }
Exemplo n.º 6
0
        public static IEverything Not(this IEverything everything)
        {
            everything.SearchText += "!";

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

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

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

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

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

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

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

            return(everything);
        }