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


C# IConfig类代码示例

本文整理汇总了C#中IConfig的典型用法代码示例。如果您正苦于以下问题:C# IConfig类的具体用法?C# IConfig怎么用?C# IConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IConfig类属于命名空间,在下文中一共展示了IConfig类的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: FindConfiguration

        protected void FindConfiguration(IConfig autoConfig)
        {
            if (autoConfig == null)
                return;

            string serverURL = autoConfig.GetString("RegistrationURI", "");
            OSDMap request = new OSDMap();
            if (serverURL == "")
            {
                //Get the urls from the config
                GetConfigFor("GridServerURI", request);
                request["RegistrationURI"] = request["GridServerURI"];
                GetConfigFor("GridUserServerURI", request);
                GetConfigFor("AssetServerURI", request);
                GetConfigFor("InventoryServerURI", request);
                GetConfigFor("AvatarServerURI", request);
                GetConfigFor("PresenceServerURI", request);
                GetConfigFor("UserInfoServerURI", request);
                GetConfigFor("UserAccountServerURI", request);
                GetConfigFor("AuthenticationServerURI", request);
                GetConfigFor("FriendsServerURI", request);
                GetConfigFor("RemoteServerURI", request);
                GetConfigFor("EventQueueServiceURI", request);
                GetConfigFor("AbuseReportURI", request);
                AddNewUrls("default", request);
            }
            else
            {
                GetConfigFor("RegistrationURI", request);
                AddNewUrls("default", request);
            }
        }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:32,代码来源:ConfigurationService.cs

示例3: Main

 // -------------------------------------------------------------------
 // Constructor
 // -------------------------------------------------------------------
 public Main(IFactory factory)
     : base(factory)
 {
     this.config = factory.Resolve<IConfig>();
     this.logic = factory.Resolve<IBuildLogic>();
     this.configRuntime = factory.Resolve<ICrystalBuildConfigurationRunTime>();
 }
开发者ID:Craiel,项目名称:CarbonProjects,代码行数:10,代码来源:Main.cs

示例4: Initialise

        // -----------------------------------------------------------------
        /// <summary>
        /// Initialise this shared module
        /// </summary>
        /// <param name="scene">this region is getting initialised</param>
        /// <param name="source">nini config, we are not using this</param>
        // -----------------------------------------------------------------
        public void Initialise(IConfigSource config)
        {
            try 
            {
                if ((m_config = config.Configs["JsonStore"]) == null)
                {
                    // There is no configuration, the module is disabled
                    // m_log.InfoFormat("[JsonStore] no configuration info");
                    return;
                }

                m_enabled = m_config.GetBoolean("Enabled", m_enabled);
                m_enableObjectStore = m_config.GetBoolean("EnableObjectStore", m_enableObjectStore);
                m_maxStringSpace = m_config.GetInt("MaxStringSpace", m_maxStringSpace);
                if (m_maxStringSpace == 0)
                    m_maxStringSpace = Int32.MaxValue;
            }
            catch (Exception e)
            {
                m_log.Error("[JsonStore]: initialization error: {0}", e);
                return;
            }

            if (m_enabled)
                m_log.DebugFormat("[JsonStore]: module is enabled");
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:33,代码来源:JsonStoreModule.cs

示例5: WriteConfig

        public override void WriteConfig(IConfig config, string password = null) {
            base.WriteConfig(config, password);

            // Writing configs may seem a little bit convoluted in Potato 2, but you should
            // think of it simply as Command serialization, which allows you to save complex
            // parameters.

            config.Append(new Command() {
                Name = "ThisIsJustACommand",
                Parameters = new List<ICommandParameter>() {
                    new CommandParameter() {
                        Data = {
                            Content = new List<String>() {
                                "Parameter1Value"
                            }
                        }
                    },
                    new CommandParameter() {
                        Data = {
                            Content = new List<String>() {
                                "Parameter2Value"
                            }
                        }
                    }
                }
            }.ToConfigCommand());
        }
开发者ID:EBassie,项目名称:Potato,代码行数:27,代码来源:Program.cs

示例6: 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

示例7: Initialize

        /// <summary>
        /// Initializes with the specified config.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <returns></returns>
        public static bool Initialize(IConfig config)
        {
            m_Config = config;

            if(!config.IndependentLogger)
                LogUtil.Setup(new ELLogger());
            else
                LogUtil.Setup(new DynamicELLogger("Logs", m_Config.GetServerList().Select(s => s.Name)));

            List<IServiceConfig> serviceList = config.GetServiceList();

            Type serviceType;

            foreach (IServiceConfig service in serviceList)
            {
                if (service.Disabled)
                    continue;

                if (!AssemblyUtil.TryGetType(service.Type, out serviceType))
                {
                    LogUtil.LogError("Failed to initialize " + service.ServiceName + "!");
                    return false;
                }

                m_ServiceDict[service.ServiceName] = serviceType;
            }

            return true;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:34,代码来源:SocketServerManager.cs

示例8: Preferences

 public Preferences(IConfig config, QuickFilters filters)
 {
     this.Build ();
     m_config = config;
     coordinateEntry.Latitude = config.HomeLat;
     coordinateEntry.Longitude = config.HomeLon;
     memberId.Text = config.OwnerID;
     unitsCombo.Active = config.ImperialUnits ? 1:0;
     nearbyCombo.Active = config.ShowNearby ? 0:1;
     childPointCombo.Active = config.ShowAllChildren? 1:0;
     dataDirEntry.Text = config.DataDirectory;
     importDirEntry.Text = config.ImportDirectory;
     WaypointSolvedMode = config.SolvedModeState;
     SetStartupFilter(filters, config.StartupFilter);
     MapPoints = config.MapPoints;
     prefixModeCombo.Active = config.IgnoreWaypointPrefixes ? 1:0;
     updateCheck.Active = config.CheckForUpdates;
     UpdateInterval = config.UpdateInterval;
     directEntryCheck.Active = config.UseDirectEntryMode;
     autoCloseCheck.Active = config.AutoCloseWindows;
     selectCachesFromMapCheck.Active = config.AutoSelectCacheFromMap;
     dnfCheck.Active = config.ShowDNFIcon;
     pollEntry.Text = config.GPSDPoll.ToString();
     recenterCheck.Active = config.GPSDAutoMoveMap;
     mapsWidget.Maps = config.OpenLayerMaps;
 }
开发者ID:TweetyHH,项目名称:Open-Cache-Manager,代码行数:26,代码来源:Preferences.cs

示例9: ExclusionFilter

		public ExclusionFilter(ILogger log, IConfig config)
		{
			m_log = log;
			m_config = config;
			m_branchRenamer = config.BranchRename;
			m_headOnlyState = RepositoryState.CreateWithBranchChangesOnly();
		}
开发者ID:runt18,项目名称:CvsntGitImporter,代码行数:7,代码来源:ExclusionFilter.cs

示例10: FileWorker

 protected FileWorker(IConfig controlConfig)
 {
     _userFolder = controlConfig.Get("UserFolder", ".");
     _sharedFolder = controlConfig.Get("SharedFolder", null);
     if (_sharedFolder != null)
         _sharedFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, _sharedFolder);
 }
开发者ID:JohnMcCaffery,项目名称:RoutingIsland,代码行数:7,代码来源:FileWorker.cs

示例11: DropDatabaseTask

 public DropDatabaseTask(IConfig config)
 {
     var url = new MongoUrl(config.ProxyDbConnectionString);
     _mongoDatabase = new MongoClient(url)
         .GetServer()
         .GetDatabase(url.DatabaseName);
 }
开发者ID:hpence,项目名称:ApiProxy,代码行数:7,代码来源:DropDatabaseTask.cs

示例12: TypeToBenchmarks

        public static Benchmark[] TypeToBenchmarks(Type type, IConfig config = null)
        {
            config = GetFullConfig(type, config);

            var allMethods = type.GetMethods();
            return MethodsToBenchmarks(type, allMethods, config);
        }
开发者ID:redknightlois,项目名称:BenchmarkDotNet,代码行数:7,代码来源:BenchmarkConverter.cs

示例13: TransmissionNetDownloader

 public TransmissionNetDownloader(IConfig config)
 {
     var settings = config.GetConfigurationSettings();
     string url = settings.TransmissionUrl;
     transmission = new TransmissionRPC(new Uri(url));
     baseDownloadDir = settings.BaseDownloadDir;
 }
开发者ID:kappy,项目名称:ShowBot,代码行数:7,代码来源:TransmissionNetDownloader.cs

示例14: DefaultLogWrapper

        public DefaultLogWrapper(string logname, IConfig config)
        {
            this.logname = logname;

            Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository();
            hierarchy.Clear();

            TraceAppender tracer = new TraceAppender();
            PatternLayout patternLayout = new PatternLayout();

            patternLayout.ConversionPattern = "%t (%-5level) - %m%n";
            patternLayout.ActivateOptions();

            tracer.Layout = patternLayout;
            tracer.ActivateOptions();
            hierarchy.Root.AddAppender(tracer);

            RollingFileAppender roller = new RollingFileAppender();
            roller.Layout = patternLayout;
            roller.AppendToFile = true;
            roller.RollingStyle = RollingFileAppender.RollingMode.Size;
            roller.MaxSizeRollBackups = 4;
            roller.MaximumFileSize = "100KB";
            roller.StaticLogFileName = true;
            roller.File = Path.Combine(config.IndexFolder, "totalrecall-" + this.logname + ".log");
            roller.ActivateOptions();
            hierarchy.Root.AddAppender(roller);

            hierarchy.Root.Level = Level.All;
            hierarchy.Configured = true;
        }
开发者ID:riadyb,项目名称:totalrecall,代码行数:31,代码来源:DefaultLogWrapper.cs

示例15: GetDatabase

 /// <summary>
 /// Returns MongoDatabase instance using config settings.
 /// If "database" setting is not specified then it's assumed that
 /// connection string contains database name
 /// </summary>
 /// <param name="settings"></param>
 /// <returns></returns>
 public static MongoDatabase GetDatabase(NameValueCollection settings, IConfig config)
 {
     string database = settings["database"];
     return string.IsNullOrEmpty(database) ?
         MongoDatabase.Create(GetConnectionString(settings, config)) :
         MongoServer.Create(GetConnectionString(settings, config)).GetDatabase(database);
 }
开发者ID:mikalai-silivonik,项目名称:bnh,代码行数:14,代码来源:ConnectionUtils.cs


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