Beispiel #1
0
        public static bool SortingSelected(IBookSorting currentSorting, string name)
        {
            var sorting     = BookSorting.BookSorting.GetReferenceByName(name);
            var sortingType = sorting.GetType();

            return(currentSorting.GetType().Equals(sortingType));
        }
Beispiel #2
0
        public static string GetPropertyName(IBookSorting sorting)
        {
            var name = sorting.GetType().Name;

            var fields = typeof(BookSorting).GetFields(BindingFlags.Static | BindingFlags.Public);

            return(fields.Single(x => ("BookSorting" + x.Name) == name).Name);
        }