Advertisement
orfen

extentions

Jan 11th, 2012
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. public enum AppSettings
  2. {
  3.     MySetting
  4. }
  5.  
  6. public class Extentions
  7. {
  8.     public static string Value(this AppSettings source)
  9.     {
  10.         return WebConfigurationManager.AppSettings[source.ToString()];
  11.     }
  12.    
  13.     public static string ToHexString(this IEnumerable<byte> source)
  14.     {
  15.         var stringBuilder = source.Aggregate(new StringBuilder(), (builder, aByte) => builder.AppendFormat("{0:x2}", aByte));
  16.         return stringBuilder.ToString();
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement