PageRenderTime 60ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/V1/trunk/Source/QuickStarts/Modularity/Modularity.Tests.AcceptanceTests/Helpers/ConfigHandler.cs

#
C# | 47 lines | 25 code | 3 blank | 19 comment | 0 complexity | c682a302912d52aced939287e5a0f7bf MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System;
  18. using System.Configuration;
  19. using System.Collections.Specialized;
  20. using Modularity.AcceptanceTests.TestInfrastructure;
  21. using System.Collections.Generic;
  22. using System.IO;
  23. using System.Collections.ObjectModel;
  24. using System.Xml.XPath;
  25. using System.Xml.Serialization;
  26. using System.Xml;
  27. using System.Data;
  28. namespace Modularity.AcceptanceTests.Helpers
  29. {
  30. /// <summary>
  31. /// Class use for handling the config file and XML Test Data reading
  32. /// </summary>
  33. public static class ConfigHandler
  34. {
  35. public static string GetValue(string key)
  36. {
  37. return ConfigurationManager.AppSettings[key] ?? String.Empty;
  38. }
  39. public static NameValueCollection GetConfigSection(string name)
  40. {
  41. return (NameValueCollection)ConfigurationManager.GetSection(name) ?? null;
  42. }
  43. }
  44. }