You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.179
Former-commit-id: a536d4f20e27294d8bbc2184d75f3a22364f7ba1
This commit is contained in:
parent
966bba02bb
commit
fad71374d0
48
external/api-doc-tools/monodoc/Monodoc/settings.cs
vendored
Normal file
48
external/api-doc-tools/monodoc/Monodoc/settings.cs
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Monodoc
|
||||
{
|
||||
public static class Config
|
||||
{
|
||||
static KeyValueConfigurationCollection libConfig;
|
||||
static KeyValueConfigurationCollection exeConfig;
|
||||
|
||||
static Config ()
|
||||
{
|
||||
try {
|
||||
var config = ConfigurationManager.OpenExeConfiguration (System.Reflection.Assembly.GetExecutingAssembly ().Location);
|
||||
libConfig = config.AppSettings.Settings;
|
||||
} catch {}
|
||||
|
||||
try {
|
||||
exeConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).AppSettings.Settings;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
public static string Get (string key)
|
||||
{
|
||||
KeyValueConfigurationElement element = null;
|
||||
// We check the configuration in order: app first and then library itself
|
||||
if (exeConfig != null)
|
||||
element = exeConfig[key];
|
||||
if (element == null && libConfig != null)
|
||||
element = libConfig[key];
|
||||
|
||||
return element == null ? null : element.Value;
|
||||
}
|
||||
|
||||
public static KeyValueConfigurationCollection AppSettings {
|
||||
get {
|
||||
return exeConfig;
|
||||
}
|
||||
}
|
||||
|
||||
public static KeyValueConfigurationCollection LibSettings {
|
||||
get {
|
||||
return libConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user