当前位置: 首页>>代码示例>>C#>>正文


C# IConfig.GetString方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:ffoliveira,项目名称:opensimulator,代码行数:26,代码来源:SimianGrid.cs

示例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;
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:27,代码来源:ProviderFactory.cs

示例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;
 }
开发者ID:Legomaniak,项目名称:PPLCG,代码行数:10,代码来源:Citace.cs

示例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"));
        }
开发者ID:txdv,项目名称:qutter,代码行数:10,代码来源:Settings.cs

示例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();
        }
开发者ID:mbgreen,项目名称:GHV,代码行数:12,代码来源:RedisConnectionManager.cs

示例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");
        }
开发者ID:pluraldj,项目名称:Bot,代码行数:14,代码来源:IronPython.cs

示例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);

            }

        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:25,代码来源:WindModule.cs

示例8: Bot

        public Bot(ServerDescriptor server, IConfig config)
            : this(server)
        {
            this.config = config;

            LoadPlugins(config.GetString("plugin-folder", "Plugins"));
            MapCommands(config);
        }
开发者ID:pluraldj,项目名称:Bot,代码行数:8,代码来源:Bot.cs

示例9: ScriptProtectionModule

        public ScriptProtectionModule(IConfig config)
		{
            m_config = config;
            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").Split(','));

            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);
            GetThreatLevel();
		}
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:8,代码来源:ScriptProtectionModule.cs

示例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);
     }
 }
开发者ID:aurora-sim,项目名称:whisper_server,代码行数:10,代码来源:MurmurService.cs

示例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);
         }
     }
 }
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:41,代码来源:Config.cs

示例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!");
		}
开发者ID:BlueWallVirtual,项目名称:SlipStream.Example,代码行数:12,代码来源:SlipStreamService.cs

示例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;
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:57,代码来源:ConfigurationLoader.cs

示例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", "");
 }
开发者ID:shangcheng,项目名称:Aurora,代码行数:15,代码来源:IWC.cs

示例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);
         }
     }
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:15,代码来源:RegionReadyModule.cs


注:本文中的IConfig.GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。