• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IConfigSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IConfigSource类属于命名空间,在下文中一共展示了IConfigSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Initialize

        public void Initialize(IConfigSource source)
        {
            IConfig config = source.Configs["SimulatorFeatures"];
            if (config != null)
            {
                m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty);
                if (m_MapImageServerURL != string.Empty)
                {
                    m_MapImageServerURL = m_MapImageServerURL.Trim();
                    if (!m_MapImageServerURL.EndsWith("/"))
                        m_MapImageServerURL = m_MapImageServerURL + "/";
                }

                m_SearchURL = config.GetString("SearchServerURI", string.Empty);
                m_MeshEnabled = config.GetBoolean("MeshEnabled", m_MeshEnabled);
                m_PhysicsMaterialsEnabled = config.GetBoolean("PhysicsMaterialsEnabled", m_MeshEnabled);
                m_DynamicPathfindingEnabled = config.GetBoolean("DynamicPathfindingEnabled", m_DynamicPathfindingEnabled);
                m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported);
            }

            // Now the chat params to be returned by the SimulatorFeatures response
            config = source.Configs["Chat"];
            if (config != null)
            {
                m_whisperdistance = config.GetInt("whisper_distance", m_whisperdistance);
                m_saydistance = config.GetInt("say_distance", m_saydistance);
                m_shoutdistance = config.GetInt("shout_distance", m_shoutdistance);
            }

            AddDefaultFeatures();
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:31,代码来源:SimulatorFeaturesModule.cs


示例3: SimulationServiceInConnector

        public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
                base(config, server, String.Empty)
        {
            //IConfig serverConfig = config.Configs["SimulationService"];
            //if (serverConfig == null)
            //    throw new Exception("No section 'SimulationService' in config file");

            //string simService = serverConfig.GetString("LocalServiceModule",
            //        String.Empty);

            //if (simService == String.Empty)
            //    throw new Exception("No SimulationService in config file");

            //Object[] args = new Object[] { config };
            m_LocalSimulationService = scene.RequestModuleInterface<ISimulationService>();
            m_LocalSimulationService = m_LocalSimulationService.GetInnerService();
                    //ServerUtils.LoadPlugin<ISimulationService>(simService, args);

            //System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no"));
            //server.AddStreamHandler(new AgentGetHandler(m_SimulationService, m_AuthenticationService));
            //server.AddStreamHandler(new AgentPostHandler(m_SimulationService, m_AuthenticationService));
            //server.AddStreamHandler(new AgentPutHandler(m_SimulationService, m_AuthenticationService));
            //server.AddStreamHandler(new AgentDeleteHandler(m_SimulationService, m_AuthenticationService));
            server.AddHTTPHandler("/agent/", new AgentHandler(m_LocalSimulationService).Handler);
            server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService).Handler);

            //server.AddStreamHandler(new ObjectPostHandler(m_SimulationService, authentication));
        }
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:28,代码来源:SimulationServiceInConnector.cs


示例4: Initialise

        public void Initialise(IConfigSource config)
        {
            IConfig conf = config.Configs["TSU.CCIR.OpenSim"];

            m_enabled = (conf != null && conf.GetBoolean("Enabled", false));
            m_log.Info(m_enabled ? "Enabled" : "Disabled");
        }
开发者ID:CCIR,项目名称:TSU.CCIR.OpenSim.LSL,代码行数:7,代码来源:TSU.CCIR.OpenSim.LSL.cs


示例5: InventoryServiceInConnector

        public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != string.Empty)
                m_ConfigName = configName;
    
            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string inventoryService = serverConfig.GetString("LocalServiceModule",
                    String.Empty);

            if (inventoryService == String.Empty)
                throw new Exception("No LocalServiceModule in config file");

            Object[] args = new Object[] { config };
            m_InventoryService =
                    ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args);

            m_userserver_url = serverConfig.GetString("UserServerURI", String.Empty);
            m_doLookup = serverConfig.GetBoolean("SessionAuthentication", false);

            AddHttpHandlers(server);
            m_log.Debug("[INVENTORY HANDLER]: handlers initialized");
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:26,代码来源:InventoryServerInConnector.cs


示例6: Initialize

        public virtual void Initialize(Scene scene, IConfigSource config)
        {
            if (!initialized)
            {
                initialized = true;

                IConfig netConfig = config.Configs["Network"];

                if (netConfig != null)
                {
                    _gridSendKey = netConfig.GetString("grid_send_key");
                }


                IConfig startupConfig = config.Configs["Communications"];
                if ((startupConfig == null)
                    || (startupConfig != null)
                    && (startupConfig.GetString("InterregionComms", "RESTComms") == "RESTComms"))
                {
                    m_log.Info("[REST COMMS]: Enabling InterregionComms RESTComms module");
                    m_enabled = true;

                    InitOnce(scene);
                }
            }

            if (!m_enabled)
                return;

            InitEach(scene);

        }
开发者ID:MatthewBeardmore,项目名称:halcyon,代码行数:32,代码来源:RESTInterregionComms.cs


示例7: LoadLibrary

        public void LoadLibrary(ILibraryService service, IConfigSource source, IRegistryCore registry)
        {
            m_service = service;
            m_registry = registry;
            m_Database = Framework.Utilities.DataManager.RequestPlugin<IInventoryData>();

            IConfig libConfig = source.Configs["InventoryIARLoader"];
            const string pLibrariesLocation = "DefaultInventory/";
            AddDefaultAssetTypes();
            if (libConfig != null)
            {
                if (libConfig.GetBoolean("WipeLibrariesOnNextLoad", false))
                {
                    service.ClearDefaultInventory(); //Nuke it
                    libConfig.Set("WipeLibrariesOnNextLoad", false);
                    source.Save();
                }
                if (libConfig.GetBoolean("PreviouslyLoaded", false))
                    return; //If it is loaded, don't reload
                foreach (string iarFileName in Directory.GetFiles(pLibrariesLocation, "*.iar"))
                {
                    LoadLibraries(iarFileName);
                }
            }
        }
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:25,代码来源:DefaultInventoryIARLoader.cs


示例8: PostStart

        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("SimulationInHandler", "") != Name)
                return;

            bool secure = handlerConfig.GetBoolean("SecureSimulation", true);
            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("SimulationInHandlerPort"));

            m_LocalSimulationService = registry.RequestModuleInterface<ISimulationService>();
            
            string path = "/" + UUID.Random().ToString() + "/agent/";

            IGridRegisterModule registerModule = registry.RequestModuleInterface<IGridRegisterModule>();
            if (registerModule != null && secure)
                registerModule.AddGenericInfo("SimulationAgent", path);
            else
            {
                secure = false;
                path = "/agent/";
            }

            server.AddHTTPHandler(path, new AgentHandler(m_LocalSimulationService.GetInnerService(), secure).Handler);
            server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService.GetInnerService()).Handler);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:25,代码来源:SimulationServiceInConnector.cs


示例9: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("ProfileConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(defaultConnectionString);

                DataManager.DataManager.RegisterPlugin(Name, this);
            }
            else
            {
                //Check to make sure that something else exists
                string m_ServerURI = source.Configs["AuroraData"].GetString("RemoteServerURI", "");
                if (m_ServerURI == "") //Blank, not set up
                {
                    OpenSim.Framework.Console.MainConsole.Instance.Output("[AuroraDataService]: Falling back on local connector for " + "ProfileConnector", "None");
                    GD = GenericData;

                    if (source.Configs[Name] != null)
                        defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                    GD.ConnectToDatabase(defaultConnectionString);

                    DataManager.DataManager.RegisterPlugin(Name, this);
                }
            }
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:31,代码来源:LocalProfileConnector.cs


示例10: ThrottleRates

        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="config">Config source to load defaults from</param>
        public ThrottleRates(IConfigSource config)
        {
            try
            {
                IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"];

                // Current default total is 66750
                Resend = throttleConfig.GetInt("resend_default", 6625);
                Land = throttleConfig.GetInt("land_default", 9125);
                Wind = throttleConfig.GetInt("wind_default", 1750);
                Cloud = throttleConfig.GetInt("cloud_default", 1750);
                Task = throttleConfig.GetInt("task_default", 18500);
                Texture = throttleConfig.GetInt("texture_default", 18500);
                Asset = throttleConfig.GetInt("asset_default", 10500);

                Total = throttleConfig.GetInt("client_throttle_max_bps", 0);

                AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
                MinimumAdaptiveThrottleRate = throttleConfig.GetInt("adaptive_throttle_min_bps", 32000);

                CannibalizeTextureRate = (double)throttleConfig.GetFloat("CannibalizeTextureRate", 0.0f);
                CannibalizeTextureRate = Util.Clamp<double>(CannibalizeTextureRate,0.0, 0.9);
            }
            catch (Exception) { }
        }
开发者ID:RadaSangOn,项目名称:workCore2,代码行数:29,代码来源:ThrottleRates.cs


示例11: Initialise

        public virtual void Initialise(Scene scene, IConfigSource config)
        {
            m_gConfig = config;

            IConfig startupConfig = m_gConfig.Configs["Startup"];

            ReadConfigAndPopulate(scene, startupConfig, "Startup");

            if (enabledYN)
            {
                m_scene = scene;
                scene.RegisterModuleInterface<IEventQueue>(this);
                
                // Register fallback handler
                // Why does EQG Fail on region crossings!
                
                //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack);

                scene.EventManager.OnNewClient += OnNewClient;

                // TODO: Leaving these open, or closing them when we
                // become a child is incorrect. It messes up TP in a big
                // way. CAPS/EQ need to be active as long as the UDP
                // circuit is there.

                scene.EventManager.OnClientClosed += ClientClosed;
                scene.EventManager.OnMakeChildAgent += MakeChildAgent;
                scene.EventManager.OnRegisterCaps += OnRegisterCaps;
            }
            else
            {
                m_gConfig = null;
            }
        
        }
开发者ID:openmetaversefoundation,项目名称:fortis-opensim,代码行数:35,代码来源:EventQueueGetModule.cs


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


示例13: Initialise

        public void Initialise(IConfigSource config)
        {
            IConfig groupsConfig = config.Configs["Groups"];

            if (groupsConfig == null)
            {
                // Do not run this module by default.
                return;
            }
            else
            {
                // if groups aren't enabled, we're not needed.
                // if we're not specified as the connector to use, then we're not wanted
                if ((groupsConfig.GetBoolean("Enabled", false) == false)
                    || (groupsConfig.GetString("ServicesConnectorModule", "Default") != Name))
                {
                    m_connectorEnabled = false;
                    return;
                }

                //m_log.InfoFormat("[AURORA-GROUPS-CONNECTOR]: Initializing {0}", this.Name);

                m_connectorEnabled = true;
            }
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:25,代码来源:AuroraDataGroupsServicesConnectorModule.cs


示例14: Initialise

        public void Initialise(IConfigSource configSource, ISimulationBase openSim)
        {
            m_configSource = configSource;
            m_openSim = openSim;
            
            IConfig config = configSource.Configs["RegionStartup"];
            if (config != null)
            {
                m_enabled = config.GetBoolean(Name + "_Enabled", m_enabled);
                if (!m_enabled)
                    return;
                if (MainConsole.Instance != null)
                    MainConsole.Instance.Commands.AddCommand("open region manager", "open region manager", "Opens the region manager", OpenRegionManager);
                m_default = config.GetString("Default") == Name;

                //Add the console command if it is the default
                if (m_default)
                    if (MainConsole.Instance != null)
                        MainConsole.Instance.Commands.AddCommand ("create region", "create region", "Create a new region.", AddRegion);
            }
            IConfig startupconfig = configSource.Configs["Startup"];
            if (startupconfig != null)
                m_noGUI = startupconfig.GetBoolean("NoGUI", false);

            m_openSim.ApplicationRegistry.StackModuleInterface<IRegionLoader>(this);
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:26,代码来源:RegionLoaderDataBaseSystem.cs


示例15: Initialise

        public void Initialise(IConfigSource config)
        {
            IConfig cnf = config.Configs["Messaging"];
            if (cnf == null)
            {
                enabled = false;
                return;
            }
            if (cnf != null && cnf.GetString("OfflineMessageModule", "None") !=
                    "OfflineMessageModule")
            {
                enabled = false;
                return;
            }

            m_RestURL = cnf.GetString("OfflineMessageURL", "");
            if (m_RestURL == "")
            {
                m_log.Error("[OFFLINE MESSAGING] Module was enabled, but no URL is given, disabling");
                enabled = false;
                return;
            }

            m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
        }
开发者ID:openmetaversefoundation,项目名称:fortis-opensim,代码行数:25,代码来源:OfflineMessageModule.cs


示例16: Initialise

        public void Initialise(IConfigSource config)
        {
            IConfig groupsConfig = config.Configs["Groups"];

            if (groupsConfig == null)
            {
                // Do not run this module by default.
                return;
            }
            else
            {
                m_groupsEnabled = groupsConfig.GetBoolean("Enabled", false);
                if (!m_groupsEnabled)
                {
                    return;
                }

                if (groupsConfig.GetString("Module", "Default") != Name)
                {
                    m_groupsEnabled = false;

                    return;
                }

                m_log.InfoFormat("[Groups]: Initializing {0}", this.Name);

                m_groupNoticesEnabled   = groupsConfig.GetBoolean("NoticesEnabled", true);
                m_debugEnabled          = groupsConfig.GetBoolean("DebugEnabled", false);
                m_levelGroupCreate      = groupsConfig.GetInt("LevelGroupCreate", 0);
            }
        }
开发者ID:JamesStallings,项目名称:opensimulator,代码行数:31,代码来源:GroupsModule.cs


示例17: Initialize

        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            if (MainConsole.Instance != null)
            {
                MainConsole.Instance.Commands.AddCommand(
                    "save archive",
                    "save archive",
                    "Saves a WhiteCore '.abackup' archive (deprecated)",
                    SaveWhiteCoreArchive, true, false);

                MainConsole.Instance.Commands.AddCommand(
                    "load archive",
                    "load archive",
                    "Loads a WhiteCore '.abackupArchive",
                    LoadWhiteCoreArchive, true, false);
            }
            //Register the extension
            const string ext = ".abackup";
            try
            {
                if(Util.IsWindows())
                {
                    RegistryKey key = Registry.ClassesRoot.CreateSubKey(ext + "\\DefaultIcon");
                    key.SetValue("", Application.StartupPath + "\\CrateDownload.ico");
                    key.Close();
                }
            }
            catch
            {
            }
            //Register the interface
            registry.RegisterModuleInterface<IWhiteCoreBackupArchiver>(this);
        }
开发者ID:CaseyraeStarfinder,项目名称:WhiteCore-Dev,代码行数:33,代码来源:WhiteCoreArchiver.cs


示例18: Initialise

        public virtual void Initialise(IConfigSource source)
        {
            IConfig config = source.Configs["InventoryService"];
            if (config == null)
            {
                m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
                throw new Exception("Inventory connector init error");
            }

            string serviceURI = config.GetString("InventoryServerURI",
                    String.Empty);

            if (serviceURI == String.Empty)
            {
                m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
                throw new Exception("Inventory connector init error");
            }
            m_ServerURI = serviceURI;

            m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);

            StatsManager.RegisterStat(
                new Stat(
                "RequestsMade", 
                "Requests made", 
                "Number of requests made to the remove inventory service", 
                "requests", 
                "inventory", 
                serviceURI, 
                StatType.Pull, 
                MeasuresOfInterest.AverageChangeOverTime,
                s => s.Value = RequestsMade,
                StatVerbosity.Debug));
        }
开发者ID:VirTecIO,项目名称:opensim,代码行数:34,代码来源:XInventoryServicesConnector.cs


示例19: Initialize

        private bool m_enabled = false; // Module is only enabled if running in grid mode

        #region IRegionModule Members

        public void Initialize(Scene scene, IConfigSource source)
        {
            if (m_firstScene == null)
            {
                m_firstScene = scene;

                IConfig startupConfig = source.Configs["Startup"];
                if (startupConfig != null)
                {
                    m_enabled = startupConfig.GetBoolean("gridmode", false);
                }

                IConfig netConfig = source.Configs["Network"];

                if (netConfig != null)
                {
                    _gridSendKey = netConfig.GetString("grid_send_key");
                }
                else
                {
                    throw new Exception("LLProxyLoginModule: Network configuration not found");
                }

                if (m_enabled)
                {
                    AddHttpHandlers();
                }
            }

            if (m_enabled)
            {
                AddScene(scene);
            }
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:38,代码来源:LLProxyLoginModule.cs


示例20: Load

        public TomlTable Load(IConfigSource source)
        {
#pragma warning disable SA1312
            IPersistableConfig _;
            return this.LoadInternal(source, out _);
#pragma warning restore SA1312
        }
开发者ID:paiden,项目名称:Nett,代码行数:7,代码来源:MergedConfig.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IConfiguration类代码示例发布时间:2022-05-24
下一篇:
C# IConfigService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap