Example #1
0
        public void AddFilter(FilterControl control)
        {
            var sfi = new SearchFilterItem();

            sfi.PropertyName = control.Property.Name.Clone() as string;
            if (control.Property is SetPropertyDef)
            {
                sfi.SelectedComparison = ((DataNew.Entities.Set)control.comparisonList.SelectedItem).Id.ToString();
                sfi.IsSetProperty      = true;
            }
            else
            {
                sfi.SelectedComparison = ((SqlComparison)control.comparisonList.SelectedItem).Name.Clone() as string;
            }
            sfi.CompareValue = control.comparisonText.Text.Clone() as string;
            this.Filters.Add(sfi);
        }
Example #2
0
 public void SetFromSave(DataNew.Entities.Game loadedGame, SearchFilterItem search)
 {
     comparisonText.Text = search.CompareValue;
     if (search.IsSetProperty)
     {
         comparisonList.SelectedItem =
             comparisonList.Items.OfType <DataNew.Entities.Set>()
             .FirstOrDefault(x => x.Id == Guid.Parse(search.SelectedComparison));
     }
     else
     {
         comparisonList.SelectedItem =
             comparisonList.Items.OfType <SqlComparison>()
             .FirstOrDefault(
                 x =>
                 x.Name.Equals(search.SelectedComparison, StringComparison.InvariantCultureIgnoreCase));
     }
     //}
 }
Example #3
0
 public void SetFromSave(DataNew.Entities.Game loadedGame, SearchFilterItem search)
 {
         comparisonText.Text = search.CompareValue;
     if (search.IsSetProperty)
     {
         comparisonList.SelectedItem =
             comparisonList.Items.OfType<DataNew.Entities.Set>()
                           .FirstOrDefault(x => x.Id == Guid.Parse(search.SelectedComparison));
         excludeSetCheck.IsChecked = search.ExcludeSetProperty;
     }
     else
     {
         comparisonList.SelectedItem =
             comparisonList.Items.OfType<SqlComparison>()
                           .FirstOrDefault(
                               x =>
                               x.Name.Equals(search.SelectedComparison, StringComparison.InvariantCultureIgnoreCase));
     }
     LinkPopUp.IsOpen = false;
     //}
 }
Example #4
0
 public void AddFilter(FilterControl control)
 {
     var sfi = new SearchFilterItem();
     sfi.PropertyName = control.Property.Name.Clone() as string;
     if (control.Property is SetPropertyDef)
     {
         sfi.SelectedComparison = ((DataNew.Entities.Set)control.comparisonList.SelectedItem).Id.ToString();
         sfi.IsSetProperty = true;
         sfi.ExcludeSetProperty = control.ExcludeSet;
     }
     else
     {
         sfi.SelectedComparison = ((SqlComparison)control.comparisonList.SelectedItem).Name.Clone() as string;
     }
     sfi.CompareValue = control.comparisonText.Text.Clone() as string;
     this.Filters.Add(sfi);
 }