private void sizefilter_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.sizequery2 != null) { ConditionalSelectComboBoxItem i = (ConditionalSelectComboBoxItem)e.AddedItems[0]; this.sizequery2.IsEnabled = i.IdentifyingName == "Between"; this.sizebox2.IsEnabled = i.IdentifyingName == "Between"; } }
private string HandleSizeQuery(long s1, long s2, string m1, string m2) { string q = ""; if (s1 == -1) { return(""); } if (s2 == -1 && ((ConditionalSelectComboBoxItem)sizefilter.SelectedItem).IdentifyingName == "Between") { s2 = s1; } ConditionalSelectComboBoxItem i = (ConditionalSelectComboBoxItem)sizefilter.SelectedItem; switch (i.IdentifyingName) { case "LargerThan": return(">" + s1 + m1); case "SmallerThan": return("<" + s1 + m1); case "Equals": return(Convert.ToString(s1) + m1); case "Between": string smallbound; string largebound; if (s2 > s1) { smallbound = Convert.ToString(s1) + m1; largebound = Convert.ToString(s2) + m2; } else { if (s2 < s1) { smallbound = Convert.ToString(s2) + m2; largebound = Convert.ToString(s1) + m1; } else { return(Convert.ToString(s1 + m1)); } } return(smallbound + ".." + largebound); default: break; } return(q); }
private void sizefilter_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!this.IsLoaded) { return; } ConditionalSelectComboBoxItem i = (ConditionalSelectComboBoxItem)e.AddedItems[0]; if (i.IdentifyingName == "Between" || i.IdentifyingName == "NotBetween") { this.sizequery2.IsEnabled = true; this.sizebox2.IsEnabled = true; } else { this.sizequery2.IsEnabled = false; this.sizebox2.IsEnabled = false; } }
public SizeSearchCriteriaDialog(string property, string value) { InitializeComponent(); ConditionalSelectComboBoxItem i = (ConditionalSelectComboBoxItem)sizefilter.SelectedItem; if (i.IdentifyingName == "Between") { this.sizequery2.IsEnabled = true; this.sizebox2.IsEnabled = true; } else { this.sizequery2.IsEnabled = false; this.sizebox2.IsEnabled = false; } //textBlock1.Text = textBlock1.Text.Replace("<category>", property); //textBox1.Text = GetValueOnly(property, value); //textBox1.Focus(); }
private void sizecheck_Checked(object sender, RoutedEventArgs e) { try { this.sizefilter.IsEnabled = true; this.sizequery1.IsEnabled = true; this.sizequery2.IsEnabled = true; this.sizebox1.IsEnabled = true; ConditionalSelectComboBoxItem i = (ConditionalSelectComboBoxItem)sizefilter.SelectedItem; if (i.IdentifyingName == "Between" || i.IdentifyingName == "NotBetween") { this.sizequery2.IsEnabled = true; this.sizebox2.IsEnabled = true; } else { this.sizequery2.IsEnabled = false; this.sizebox2.IsEnabled = false; } } catch { } }