This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IEnumerable<string> GetAlternateSpellings(string baseName) | |
| { | |
| if (string.IsNullOrWhiteSpace(baseName)) | |
| yield break; | |
| yield return baseName; | |
| if (baseName.Contains("_")) | |
| { | |
| yield return Regex.Replace(baseName, @"(_)([a-z])", m => m.Groups.Cast<Group>().Last().Value.ToUpper()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ObservableCollectionExtensions | |
| { | |
| public static IDisposable SuppressCollectionEvents(this INotifyCollectionChanged collection, | |
| bool fireEventWhenComplete = true) | |
| { | |
| return new CollectionEventSuppressor(collection, fireEventWhenComplete); | |
| } | |
| private class CollectionEventSuppressor : IDisposable | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class EnumerableExtensions | |
| { | |
| public static string StringJoin<T>(this IEnumerable<T> source, string delimiter) | |
| { | |
| return string.Join(delimiter, source); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static async Task WaitForValue<T>(this INotifyPropertyChanged toObserve, | |
| Expression<Func<T>> propertyExpression, | |
| T valueToAwait, | |
| IEqualityComparer<T> comparer = null) | |
| { | |
| comparer = comparer ?? EqualityComparer<T>.Default; | |
| var getValue = propertyExpression.Compile(); | |
| if (comparer.Equals(getValue(), valueToAwait)) | |
| return; |
OlderNewer