Beispiel #1
0
 private void FilterImplementation(object o)
 {
     if (SelectedProperty.Contains("Name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Name.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Last name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.LastName.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Birthday.ToShortDateString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Email"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.Email.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Is adult"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.IsAdult.ToString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Is birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.IsBirthday.ToString().Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Sun sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.SunSign.Contains(Query) select i);
     }
     else if (SelectedProperty.Contains("Chinese sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons where i.ChineseSign.Contains(Query) select i);
     }
 }
Beispiel #2
0
 private void SortImplementation(object o)
 {
     if (SelectedProperty.Contains("Name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Name ascending select i);
     }
     else if (SelectedProperty.Contains("Last name"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.LastName ascending select i);
     }
     else if (SelectedProperty.Contains("Birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Birthday ascending select i);
     }
     else if (SelectedProperty.Contains("Email"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.Email ascending select i);
     }
     else if (SelectedProperty.Contains("Is adult"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.IsAdult ascending select i);
     }
     else if (SelectedProperty.Contains("Is birthday"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.IsBirthday ascending select i);
     }
     else if (SelectedProperty.Contains("Sun sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.SunSign ascending select i);
     }
     else if (SelectedProperty.Contains("Chinese sign"))
     {
         Persons = new ObservableCollection <Person>(from i in Persons orderby i.ChineseSign ascending select i);
     }
 }
Beispiel #3
0
 private void SortImplementation(object obj)
 {
     if (SelectedProperty.Contains("Name"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessName ascending select i);
     }
     else if (SelectedProperty.Contains("ID"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessID ascending select i);
     }
     else if (SelectedProperty.Contains("Active"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.IsAlive ascending select i);
     }
     else if (SelectedProperty.Contains("CPU"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.Cpu ascending select i);
     }
     else if (SelectedProperty.Contains("RAM, MB"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.RamSize ascending select i);
     }
     else if (SelectedProperty.Contains("RAM, %"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.RamPercents ascending select i);
     }
     else if (SelectedProperty.Contains("Threads"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ThreadsAmount ascending select i);
     }
     else if (SelectedProperty.Contains("User"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.ProcessOwner ascending select i);
     }
     else if (SelectedProperty.Contains("Path"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.FileName ascending select i);
     }
     else if (SelectedProperty.Contains("LaunchTime"))
     {
         ProcessesList = new ObservableCollection <ProcessListItem>(from i in ProcessesList orderby i.LaunchDateTime ascending select i);
     }
 }