本文整理汇总了C#中IConfig.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# IConfig.GetString方法的具体用法?C# IConfig.GetString怎么用?C# IConfig.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfig
的用法示例。
在下文中一共展示了IConfig.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
public void Initialise(IConfigSource config)
{
try
{
m_config = config.Configs["SimianGrid"];
if (m_config != null)
{
m_simianURL = m_config.GetString("SimianServiceURL");
if (String.IsNullOrEmpty(m_simianURL))
{
// m_log.DebugFormat("[SimianGrid] service URL is not defined");
return;
}
InitialiseSimCap();
SimulatorCapability = SimulatorCapability.Trim();
m_log.InfoFormat("[SimianExternalCaps] using {0} as simulator capability",SimulatorCapability);
}
}
catch (Exception e)
{
m_log.ErrorFormat("[SimianExternalCaps] initialization error: {0}",e.Message);
return;
}
}
示例2: GetProviderFromConfigName
public static IGroupDataProvider GetProviderFromConfigName(ILog log, IConfig groupsConfig, string configName)
{
switch (configName)
{
case "XmlRpc":
string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL");
bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false);
string ServiceReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", String.Empty);
string ServiceWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", String.Empty);
log.InfoFormat("[GROUPS]: XmlRpc Service URL set to: {0}", ServiceURL);
return new XmlRpcGroupDataProvider(ServiceURL, DisableKeepAlive, ServiceReadKey, ServiceWriteKey);
case "Native":
string dbType = groupsConfig.GetString("NativeProviderDBType");
string connStr = groupsConfig.GetString("NativeProviderConnString");
ConnectionFactory connFactory = new ConnectionFactory(dbType, connStr);
return new NativeGroupDataProvider(connFactory);
}
return null;
}
示例3: Load
public EReturn Load(IConfig config)
{
if (config != null)
{
Text = config.GetString("Text");
Autor = config.GetString("Autor");
return EReturn.NoError;
}
else return EReturn.Error;
}
示例4: CoreAccount
public CoreAccount(int i, IConfig config)
{
Index = i;
Name = config.GetString(_("AccountName"));
HostName = config.GetString(_("HostName"));
Password = config.GetString(_("Password"));
Port = config.GetInt(_("Port"));
User = config.GetString(_("User"));
}
示例5: RedisConnectionManager
public RedisConnectionManager(IConfig config)
{
ConfigurationOptions options = new ConfigurationOptions();
options.EndPoints.Add(config.GetString("redisCacheHostName"), config.GetInt("redisCachePortNumber"));
options.Ssl = config.GetBool("redisCacheUseSSL");
options.Password = config.GetString("redisCachePassword");
options.AbortOnConnectFail = false;
options.ConnectTimeout = 30000;
connection = ConnectionMultiplexer.Connect(options);
cache = connection.GetDatabase();
}
示例6: Initialize
public void Initialize(IConfig config)
{
log.Info("Initializing \"IronPython\" plugin...");
this.config = config;
commandIdentifier = config.GetString("command-identifier", "!");
log.Info("Creating Python runtime...");
ipy = Python.CreateEngine();
LoadScripts(config.GetString("script-folder", "Scripts"));
log.Info("Plugin \"IronPython\" loaded");
}
示例7: Initialise
public void Initialise(IConfigSource config)
{
m_windConfig = config.Configs["Wind"];
// string desiredWindPlugin = m_dWindPluginName;
if (m_windConfig != null)
{
m_enabled = m_windConfig.GetBoolean("enabled", true);
m_frameUpdateRate = m_windConfig.GetInt("wind_update_rate", 150);
// Determine which wind model plugin is desired
if (m_windConfig.Contains("wind_plugin"))
{
m_dWindPluginName = m_windConfig.GetString("wind_plugin", m_dWindPluginName);
}
}
if (m_enabled)
{
m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate);
}
}
示例8: Bot
public Bot(ServerDescriptor server, IConfig config)
: this(server)
{
this.config = config;
LoadPlugins(config.GetString("plugin-folder", "Plugins"));
MapCommands(config);
}
示例9: ScriptProtectionModule
public ScriptProtectionModule(IConfig config)
{
m_config = config;
EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").Split(','));
allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);
GetThreatLevel();
}
示例10: Initialize
public void Initialize(IConfigSource config, IRegistryCore registry)
{
m_config = config.Configs["MurmurService"];
if (m_config != null)
{
bool enabled = m_config.GetString("MurmurService") == GetType().Name;
if(enabled)
registry.RegisterModuleInterface<IMurmurService>(this);
}
}
示例11: SimpleCurrencyConfig
public SimpleCurrencyConfig(IConfig economyConfig)
{
foreach (PropertyInfo propertyInfo in GetType().GetProperties())
{
try
{
if (propertyInfo.PropertyType.IsAssignableFrom(typeof (float)))
propertyInfo.SetValue(this,
economyConfig.GetFloat(propertyInfo.Name,
float.Parse(
propertyInfo.GetValue(this, new object[0])
.ToString())), new object[0]);
else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (int)))
propertyInfo.SetValue(this,
economyConfig.GetInt(propertyInfo.Name,
int.Parse(
propertyInfo.GetValue(this, new object[0])
.ToString())), new object[0]);
else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (bool)))
propertyInfo.SetValue(this,
economyConfig.GetBoolean(propertyInfo.Name,
bool.Parse(
propertyInfo.GetValue(this, new object[0])
.ToString())), new object[0]);
else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (string)))
propertyInfo.SetValue(this,
economyConfig.GetString(propertyInfo.Name,
propertyInfo.GetValue(this, new object[0])
.ToString()), new object[0]);
else if (propertyInfo.PropertyType.IsAssignableFrom(typeof (UUID)))
propertyInfo.SetValue(this,
new UUID(economyConfig.GetString(propertyInfo.Name,
propertyInfo.GetValue(this, new object[0])
.ToString())), new object[0]);
}
catch (Exception)
{
MainConsole.Instance.Warn("[SimpleCurrency]: Exception reading economy config: " + propertyInfo.Name);
}
}
}
示例12: ExampleService
public ExampleService(IConfigSource config, string configName)
: base(config)
{
m_log.InfoFormat("[SLIPSTREAM]: running ExampleService constructor");
Config = config.Configs[configName];
if(Config == null)
{
m_log.InfoFormat("[SLIPSTREAM]: Configuration section {0} not found!", configName);
return;
}
Message = Config.GetString("PageMessage", "Hello!");
}
示例13: LoadConfigSettings
/// <summary>
/// Loads the region configuration
/// </summary>
/// <param name="argvSource">Parameters passed into the process when started</param>
/// <param name="configSettings"></param>
/// <param name="networkInfo"></param>
/// <returns>A configuration that gets passed to modules</returns>
public IConfigSource LoadConfigSettings(IConfig startupConfig)
{
bool iniFileExists = false;
List<string> sources = new List<string>();
string iniFileName = startupConfig.GetString("inifile", Path.Combine(".", "OpenSim.ini"));
if (IsUri(iniFileName))
{
if (!sources.Contains(iniFileName))
sources.Add(iniFileName);
}
else
{
if (File.Exists(iniFileName))
{
if (!sources.Contains(iniFileName))
sources.Add(iniFileName);
}
}
m_config = new IniConfigSource();
m_config.Merge(DefaultConfig());
m_log.Info("[CONFIG] Reading configuration settings");
if (sources.Count == 0)
{
m_log.FatalFormat("[CONFIG] Could not load any configuration");
m_log.FatalFormat("[CONFIG] Did you copy the OpenSim.ini.example file to OpenSim.ini?");
Environment.Exit(1);
}
for (int i = 0 ; i < sources.Count ; i++)
{
if (ReadConfig(sources[i]))
iniFileExists = true;
AddIncludes(sources);
}
if (!iniFileExists)
{
m_log.FatalFormat("[CONFIG] Could not load any configuration");
m_log.FatalFormat("[CONFIG] Configuration exists, but there was an error loading it!");
Environment.Exit(1);
}
return m_config;
}
示例14: Initialise
public void Initialise(IConfigSource source)
{
if (source.Configs["AuroraInterWorldConnectors"] != null)
{
if (source.Configs["AuroraInterWorldConnectors"].GetBoolean(
"Enabled", true) !=
true)
{
m_Enabled = false;
return;
}
}
m_config = source.Configs["AuroraInterWorldConnectors"];
OurPassword = m_config.GetString("OurPassword", "");
}
示例15: Initialise
public void Initialise(IConfigSource config)
{
m_config = config.Configs["RegionReady"];
if (m_config != null)
{
m_enabled = m_config.GetBoolean("enabled", false);
if (m_enabled)
{
m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
m_disable_logins = m_config.GetBoolean("login_disable", false);
m_uri = m_config.GetString("alert_uri",string.Empty);
}
}
}