PageRenderTime 13ms CodeModel.GetById 11ms app.highlight 1ms 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
18using System;
19using System.Configuration;
20using System.Collections.Specialized;
21using Modularity.AcceptanceTests.TestInfrastructure;
22using System.Collections.Generic;
23using System.IO;
24using System.Collections.ObjectModel;
25using System.Xml.XPath;
26using System.Xml.Serialization;
27using System.Xml;
28using System.Data;
29
30namespace Modularity.AcceptanceTests.Helpers
31{
32    /// <summary>
33    /// Class use for handling the config file and XML Test Data reading
34    /// </summary>
35    public static class ConfigHandler
36    {
37        public static string GetValue(string key)
38        {
39            return ConfigurationManager.AppSettings[key] ?? String.Empty;
40        }
41
42        public static NameValueCollection GetConfigSection(string name)
43        {
44            return (NameValueCollection)ConfigurationManager.GetSection(name) ?? null;
45        }
46    }
47}