You've already forked linux-packaging-mono
acceptance-tests
data
docs
external
Newtonsoft.Json
api-doc-tools
external
mdoc
monodoc
Assembly
Mono.Documentation
Mono.Utilities
Monodoc
caches
generators
providers
storage
HelpSource.cs
HelpSource_Legacy.cs
Node.cs
Node_Legacy.cs
Provider.cs
RootTree.cs
RootTree_Legacy.cs
SearchableDocument.cs
SearchableIndex.cs
Tree.cs
TypeUtils.cs
cache.cs
generator.cs
index.cs
settings.cs
settings_Legacy.cs
storage.cs
Monodoc.Ecma
Properties
Resources
Test
Makefile
jay.sh
monodoc.csproj
monodoc.dll.config
.gitignore
.gitmodules
Makefile
README.md
apidoctools.sln
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|