/// <summary> /// Comparison method between two objects of the same type, used for sorting. /// Because the CompareTo method is strongly typed by generic constraints, /// it is not necessary to test for the correct object type. /// </summary> /// <param name="other">The other object of this type we are comparing to</param> /// <returns></returns> public virtual int CompareTo(CreateUpdateInputDtoBase <TIdType> other) { // put comparison of properties in here // for base object we'll just sort by id and culture return(Id.ToString().CompareTo(other.Id.ToString()) + Culture.CompareTo(other.Culture) ); }
/// <summary> /// Comparison method between two objects of the same type, used for sorting. /// Because the CompareTo method is strongly typed by generic constraints, /// it is not necessary to test for the correct object type. /// </summary> /// <param name="other">The other object of this type we are comparing to</param> /// <returns></returns> public virtual int CompareTo(GetAllInputDtoBase <TIdType> other) { // put comparison of properties in here // for base object we'll just sort by id and culture return(Name.CompareTo(other.Name) + Culture.CompareTo(other.Culture) ); }
private async void AddLanguage(object sender, RoutedEventArgs e) { if (Culture.SelectedItem != null) { Culture selectedCulture = Culture.SelectedItem as Culture; if (selectedCulture == null) { return; } if (selectedCulture.CompareTo(App.MainWindow.Document.AssembliesLanguage)) { await App.MainWindow.ShowMessage(StringUtils.String("MB_CultureSameAsNeutral"), MessageBoxButton.OK); return; } App.MainWindow.Document.AddLanguage((Culture)Culture.SelectedItem); pp_Languages languagesPage = new pp_Languages(); App.MainWindow.AnimatedNavigate(App.MainWindow.DocumentPageFrame, languagesPage, NavigationAnimation.FadeToRight); } }