Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1.     public static class Config
  2.     {
  3.         public class Items : DynamicObject
  4.         {
  5.             private NameValueCollection _items;
  6.  
  7.             public Items()
  8.             {
  9.                 _items = ConfigurationManager.AppSettings;
  10.             }
  11.  
  12.             public override bool TryGetMember(GetMemberBinder binder, out object result)
  13.             {
  14.                 result = _items[binder.Name];
  15.                 return result != null;
  16.             }
  17.         }
  18.  
  19.         public static Items Instance { get { return new Items(); } }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement