本文整理汇总了C#中Nini.Config.IniConfigSource.AddConfig方法的典型用法代码示例。如果您正苦于以下问题:C# IniConfigSource.AddConfig方法的具体用法?C# IniConfigSource.AddConfig怎么用?C# IniConfigSource.AddConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nini.Config.IniConfigSource
的用法示例。
在下文中一共展示了IniConfigSource.AddConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDeRezSceneObject
public void TestDeRezSceneObject()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
TestScene scene = SceneSetupHelpers.SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true);
SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
sogd.Enabled = false;
SceneObjectPart part
= new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
part.Name = "obj1";
scene.AddNewSceneObject(new SceneObjectGroup(part), false);
List<uint> localIds = new List<uint>();
localIds.Add(part.LocalId);
scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
sogd.InventoryDeQueueAndDelete();
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Null);
}
示例2: TestAddAsset
public void TestAddAsset()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
config.AddConfig("AssetService");
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
LocalAssetServicesConnector lasc = new LocalAssetServicesConnector();
lasc.Initialise(config);
AssetBase a1 = AssetHelpers.CreateNotecardAsset();
lasc.Store(a1);
AssetBase retreivedA1 = lasc.Get(a1.ID);
Assert.That(retreivedA1.ID, Is.EqualTo(a1.ID));
Assert.That(retreivedA1.Metadata.ID, Is.EqualTo(a1.Metadata.ID));
Assert.That(retreivedA1.Data.Length, Is.EqualTo(a1.Data.Length));
AssetMetadata retrievedA1Metadata = lasc.GetMetadata(a1.ID);
Assert.That(retrievedA1Metadata.ID, Is.EqualTo(a1.ID));
byte[] retrievedA1Data = lasc.GetData(a1.ID);
Assert.That(retrievedA1Data.Length, Is.EqualTo(a1.Data.Length));
// TODO: Add cache and check that this does receive a copy of the asset
}
示例3: SetUp
public override void SetUp()
{
base.SetUp();
uint port = 9999;
uint sslPort = 9998;
// This is an unfortunate bit of clean up we have to do because MainServer manages things through static
// variables and the VM is not restarted between tests.
MainServer.RemoveHttpServer(port);
BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
IConfigSource config = new IniConfigSource();
config.AddConfig("Startup");
config.Configs["Startup"].Set("EventQueue", "true");
CapabilitiesModule capsModule = new CapabilitiesModule();
m_eqgMod = new EventQueueGetModule();
// For NPC test support
config.AddConfig("NPC");
config.Configs["NPC"].Set("Enabled", "true");
m_npcMod = new NPCModule();
m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, capsModule, m_eqgMod, m_npcMod);
}
示例4: SetupNeighbourRegions
private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
{
// XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
// CapabilitiesModule complain when it can't set up HTTP endpoints.
// BaseHttpServer httpServer = new BaseHttpServer(99999);
// MainServer.AddHttpServer(httpServer);
// MainServer.Instance = httpServer;
// We need entity transfer modules so that when sp2 logs into the east region, the region calls
// EntityTransferModuleto set up a child agent on the west region.
// XXX: However, this is not an entity transfer so is misleading.
EntityTransferModule etmA = new EntityTransferModule();
EntityTransferModule etmB = new EntityTransferModule();
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
IConfigSource config = new IniConfigSource();
config.AddConfig("Chat");
IConfig modulesConfig = config.AddConfig("Modules");
modulesConfig.Set("EntityTransferModule", etmA.Name);
modulesConfig.Set("SimulationServices", lscm.Name);
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());
SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
}
示例5: Init
public void Init()
{
//AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
// Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
m_xEngine = new XEngine();
// Necessary to stop serialization complaining
WorldCommModule wcModule = new WorldCommModule();
IniConfigSource configSource = new IniConfigSource();
IConfig startupConfig = configSource.AddConfig("Startup");
startupConfig.Set("DefaultScriptEngine", "XEngine");
IConfig xEngineConfig = configSource.AddConfig("XEngine");
xEngineConfig.Set("Enabled", "true");
// These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call
// to AssemblyResolver.OnAssemblyResolve fails.
xEngineConfig.Set("AppDomainLoading", "false");
m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;
m_scene.StartScripts();
}
示例6: AddNewConfigsAndKeys
public void AddNewConfigsAndKeys()
{
// Add some new configs and keys here and test.
StringWriter writer = new StringWriter ();
writer.WriteLine ("[Pets]");
writer.WriteLine (" cat = muffy");
writer.WriteLine (" dog = rover");
IniConfigSource source = new IniConfigSource
(new StringReader (writer.ToString ()));
IConfig config = source.Configs["Pets"];
Assert.AreEqual ("Pets", config.Name);
Assert.AreEqual (2, config.GetKeys ().Length);
IConfig newConfig = source.AddConfig ("NewTest");
newConfig.Set ("Author", "Brent");
newConfig.Set ("Birthday", "February 8th");
newConfig = source.AddConfig ("AnotherNew");
Assert.AreEqual (3, source.Configs.Count);
config = source.Configs["NewTest"];
Assert.IsNotNull (config);
Assert.AreEqual (2, config.GetKeys ().Length);
Assert.AreEqual ("February 8th", config.Get ("Birthday"));
Assert.AreEqual ("Brent", config.Get ("Author"));
}
示例7: saveZigFile
private bool saveZigFile()
{
bool retVal = false;
try
{
IniConfigSource source = new IniConfigSource();
string appDataPath = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ZigGIS";
if (!System.IO.Directory.Exists(appDataPath))
{
System.IO.Directory.CreateDirectory(appDataPath);
}
IConfig config = source.AddConfig("connection");
config.Set("server", this.txtServer.Text);
config.Set("port", this.txtSchema.Text);
config.Set("database", this.txtDatabase.Text);
config.Set("user", this.txtUserName.Text);
config.Set("password", this.txtPassword.Text);
config = source.AddConfig("logging");
config.Set("configfile", this.txtLogFile.Text);
string zigFileName = this.txtServer.Text + "." + this.txtDatabase.Text + "." + this.txtUserName.Text + "." + System.Guid.NewGuid().ToString() + ".zig";
source.Save(appDataPath + "\\" + zigFileName);
return retVal;
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
}
示例8: InitialiseSomerBlinkConfigFileAtPath
/// <summary>
/// Initialises the somer blink configuration file at path.
/// </summary>
/// <param name="path">The path.</param>
public static void InitialiseSomerBlinkConfigFileAtPath(string path)
{
var source = new IniConfigSource();
source.AddConfig("Credentials");
source.Configs["Credentials"].Set("Username", "");
source.Configs["Credentials"].Set("Password", "");
source.AddConfig("Settings");
source.Configs["Settings"].Set("MinWaitTime", "2000");
source.Configs["Settings"].Set("MaxWaitTime", "60000");
source.Configs["Settings"].Set("MinBlinkBidIsk", "2500000");
source.Configs["Settings"].Set("MaxBlinkBidIsk", "10000000");
source.Configs["Settings"].Set("DownTime", "4");
source.Configs["Settings"].Set("RunTime", "4");
source.AddConfig("Extra");
source.Configs["Settings"].Set("DebugMode", "0");
source.Configs["Settings"].Set("proxyIp", "x.x.x.x");
source.Configs["Settings"].Set("proxyPort", "8080");
source.Configs["Settings"].Set("proxyUser", "");
source.Configs["Settings"].Set("proxyPass", "");
source.Configs["Settings"].Set("useProxy", "false");
source.Save(path);
SaveToDesktop(path);
Logger.LogMessage();
Logger.LogMessage("--------------------");
Logger.LogMessage("ConfigFile shortcut created on desktop");
}
示例9: DefaultConfig
private static IConfigSource DefaultConfig()
{
IConfigSource result = new IniConfigSource();
{
IConfig config = result.AddConfig("Config");
config.Set("listen_port", 8003);
config.Set("assetset_location", String.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar));
}
{
IConfig config = result.AddConfig("Plugins");
config.Set("asset_storage_provider", "OpenSimAssetStorage");
config.Set("inventory_storage_provider", "OpenSimInventoryStorage");
config.Set("authentication_provider", "NullAuthentication");
config.Set("authorization_provider", "AuthorizeAll");
config.Set("metrics_provider", "NullMetrics");
config.Set("frontends", "ReferenceFrontend,OpenSimAssetFrontend,OpenSimInventoryFrontend,BrowseFrontend");
}
{
IConfig config = result.AddConfig("OpenSim");
config.Set("asset_database_provider", "OpenSim.Data.MySQL.dll");
config.Set("inventory_database_provider", "OpenSim.Data.MySQL.dll");
config.Set("asset_database_connect", String.Empty);
config.Set("inventory_database_connect", String.Empty);
}
return result;
}
示例10: TestShareWithGroup
public void TestShareWithGroup()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig startupConfig = configSource.AddConfig("Startup");
startupConfig.Set("serverside_object_permissions", true);
IConfig groupsConfig = configSource.AddConfig("Groups");
groupsConfig.Set("Enabled", true);
groupsConfig.Set("Module", "GroupsModule");
groupsConfig.Set("DebugEnabled", true);
SceneHelpers.SetupSceneModules(
scene, configSource, new object[]
{ new PermissionsModule(),
new GroupsModule(),
new MockGroupsServicesConnector() });
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
}
示例11: CreateBasicPhysicsEngine
// 'engineName' is the Bullet engine to use. Either null (for unmanaged), "BulletUnmanaged" or "BulletXNA"
// 'params' is a set of keyValue pairs to set in the engine's configuration file (override defaults)
// May be 'null' if there are no overrides.
public static BSScene CreateBasicPhysicsEngine(Dictionary<string,string> paramOverrides)
{
IConfigSource openSimINI = new IniConfigSource();
IConfig startupConfig = openSimINI.AddConfig("Startup");
startupConfig.Set("physics", "BulletSim");
startupConfig.Set("meshing", "Meshmerizer");
startupConfig.Set("cacheSculptMaps", "false"); // meshmerizer shouldn't save maps
IConfig bulletSimConfig = openSimINI.AddConfig("BulletSim");
// If the caller cares, specify the bullet engine otherwise it will default to "BulletUnmanaged".
// bulletSimConfig.Set("BulletEngine", "BulletUnmanaged");
// bulletSimConfig.Set("BulletEngine", "BulletXNA");
bulletSimConfig.Set("MeshSculptedPrim", "false");
bulletSimConfig.Set("ForceSimplePrimMeshing", "true");
if (paramOverrides != null)
{
foreach (KeyValuePair<string, string> kvp in paramOverrides)
{
bulletSimConfig.Set(kvp.Key, kvp.Value);
}
}
// If a special directory exists, put detailed logging therein.
// This allows local testing/debugging without having to worry that the build engine will output logs.
if (Directory.Exists("physlogs"))
{
bulletSimConfig.Set("PhysicsLoggingDir","./physlogs");
bulletSimConfig.Set("PhysicsLoggingEnabled","True");
bulletSimConfig.Set("PhysicsLoggingDoFlush","True");
bulletSimConfig.Set("VehicleLoggingEnabled","True");
}
Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
RegionInfo info = new RegionInfo();
info.RegionName = "BSTestRegion";
info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info);
IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer();
INonSharedRegionModule mod = mesher as INonSharedRegionModule;
mod.Initialise(openSimINI);
mod.AddRegion(scene);
mod.RegionLoaded(scene);
BSScene pScene = new BSScene();
mod = (pScene as INonSharedRegionModule);
mod.Initialise(openSimINI);
mod.AddRegion(scene);
mod.RegionLoaded(scene);
// Since the asset requestor is not initialized, any mesh or sculptie will be a cube.
// In the future, add a fake asset fetcher to get meshes and sculpts.
// bsScene.RequestAssetMethod = ???;
return pScene;
}
示例12: SetUp
private void SetUp()
{
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.AddConfig("GridService");
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
m_LocalConnector = new LocalGridServicesConnector(config);
}
示例13: SetUp
public void SetUp()
{
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.Configs["Modules"].Set("AssetCaching", "FlotsamAssetCache");
config.AddConfig("AssetCache");
config.Configs["AssetCache"].Set("FileCacheEnabled", "false");
config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
m_cache = new FlotsamAssetCache();
m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_cache);
}
示例14: SetUp
private void SetUp()
{
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.AddConfig("PresenceService");
config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");
config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
m_LocalConnector = new LocalPresenceServicesConnector(config);
// Let's stick in a test presence
m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero);
}
示例15: CreateBasicPhysicsEngine
// 'engineName' is the Bullet engine to use. Either null (for unmanaged), "BulletUnmanaged" or "BulletXNA"
// 'params' is a set of keyValue pairs to set in the engine's configuration file (override defaults)
// May be 'null' if there are no overrides.
public static BSScene CreateBasicPhysicsEngine(Dictionary<string,string> paramOverrides)
{
IConfigSource openSimINI = new IniConfigSource();
IConfig startupConfig = openSimINI.AddConfig("Startup");
startupConfig.Set("physics", "BulletSim");
startupConfig.Set("meshing", "Meshmerizer");
startupConfig.Set("cacheSculptMaps", "false"); // meshmerizer shouldn't save maps
IConfig bulletSimConfig = openSimINI.AddConfig("BulletSim");
// If the caller cares, specify the bullet engine otherwise it will default to "BulletUnmanaged".
// bulletSimConfig.Set("BulletEngine", "BulletUnmanaged");
// bulletSimConfig.Set("BulletEngine", "BulletXNA");
bulletSimConfig.Set("MeshSculptedPrim", "false");
bulletSimConfig.Set("ForceSimplePrimMeshing", "true");
if (paramOverrides != null)
{
foreach (KeyValuePair<string, string> kvp in paramOverrides)
{
bulletSimConfig.Set(kvp.Key, kvp.Value);
}
}
// If a special directory exists, put detailed logging therein.
// This allows local testing/debugging without having to worry that the build engine will output logs.
if (Directory.Exists("physlogs"))
{
bulletSimConfig.Set("PhysicsLoggingDir","./physlogs");
bulletSimConfig.Set("PhysicsLoggingEnabled","True");
bulletSimConfig.Set("PhysicsLoggingDoFlush","True");
bulletSimConfig.Set("VehicleLoggingEnabled","True");
}
PhysicsPluginManager physicsPluginManager;
physicsPluginManager = new PhysicsPluginManager();
physicsPluginManager.LoadPluginsFromAssemblies("Physics");
Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(
"BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent);
BSScene bsScene = pScene as BSScene;
// Since the asset requestor is not initialized, any mesh or sculptie will be a cube.
// In the future, add a fake asset fetcher to get meshes and sculpts.
// bsScene.RequestAssetMethod = ???;
return bsScene;
}