internal static ISortingDevice <Tsorted> GetSortingDevice <Tsorted, Tsorter>() { ISortingDevice <Tsorted> sortingDevice = null; sortingDevice = (ISortingDevice <Tsorted>)(Activator.CreateInstance(typeof(Tsorter))); if (sortingDevice == null) { sortingDevice = (ISortingDevice <Tsorted>)(new DefaultSortingDevice <Tsorted>()); } return(sortingDevice); }
protected void ApplySorting <Tsorted, Tsorter>(ref List <Tsorted> elements, string member) { ISortingDevice <Tsorted> sortDevice = SortingFactory.GetSortingDevice <Tsorted, Tsorter>(); if (sortDevice != null) { if (member == null) { sortDevice.ApplySorting(ref elements); } else { sortDevice.ApplySorting(ref elements, member); } } }