comparison ServerMonitor/Helpers.cs @ 2:453ecc1ed9ea

Disk space check
author Brad Greco <brad@bgreco.net>
date Sun, 06 Jan 2019 20:49:08 -0500
parents 3e1a2131f897
children 3142e52cbe69
comparison
equal deleted inserted replaced
1:9e92780ebc0f 2:453ecc1ed9ea
29 public static bool IsNullOrEmpty(this string aString) 29 public static bool IsNullOrEmpty(this string aString)
30 { 30 {
31 return aString == null || aString.Trim() == string.Empty; 31 return aString == null || aString.Trim() == string.Empty;
32 } 32 }
33 33
34 public static string ConvertNewlines(this string aString)
35 {
36 return aString.Replace("\r\n", "\n").Replace('\r', '\n');
37 }
38
34 public static T GetAttribute<T>(this Type type) where T : Attribute 39 public static T GetAttribute<T>(this Type type) where T : Attribute
35 { 40 {
36 return type.GetCustomAttributes(typeof(T), false).SingleOrDefault() as T; 41 return type.GetCustomAttributes(typeof(T), false).SingleOrDefault() as T;
37 } 42 }
38 43