/// <summary> /// Button4_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button4_Click(object sender, RoutedEventArgs e) { // check and indicate if T is subset of A SubsetIndicatorT = SetT.All(x => SetA.Contains(x)); if (SubsetIndicatorT) { Console.Beep(); } else { Console.Beep(); Console.Beep(); } // execute the LINQ commands IntersectionAB = new ObservableCollection <string>(SetA.Intersect(SetB)); UnionAB = new ObservableCollection <string>(SetA.Union(SetB)); RelativeComplementAB = new ObservableCollection <string>(SetA.Except(SetB)); }
/// <summary> /// Button4_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button4_Click(object sender, RoutedEventArgs e) { // check and indicate if T is subset of A SubsetIndicatorT = SetT.All(x => SetA.Contains(x, new KeyAndTimeComparer())); if (SubsetIndicatorT) { Console.Beep(); } else { Console.Beep(); Console.Beep(); } // execute the LINQ commands var ResultSet = SetA.Intersect(SetB, new KeyAndTimeComparer()); IntersectionAB = new ObservableCollection <KeyAndTime>(ResultSet.ToList <KeyAndTime>()); ResultSet = SetA.Union(SetB, new KeyAndTimeComparer()); UnionAB = new ObservableCollection <KeyAndTime>(ResultSet.ToList <KeyAndTime>()); ResultSet = SetA.Except(SetB, new KeyAndTimeComparer()); RelativeComplementAB = new ObservableCollection <KeyAndTime>(ResultSet.ToList <KeyAndTime>()); }