本文整理汇总了C#中Raven.Client.Embedded.EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb方法的典型用法代码示例。如果您正苦于以下问题:C# EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb方法的具体用法?C# EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb怎么用?C# EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Raven.Client.Embedded.EmbeddableDocumentStore
的用法示例。
在下文中一共展示了EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WaitForUserToContinueTheTest
public static void WaitForUserToContinueTheTest(EmbeddableDocumentStore documentStore, bool debug = true)
{
if (debug && Debugger.IsAttached == false)
return;
documentStore.SetStudioConfigToAllowSingleDb();
documentStore.DatabaseCommands.Put("Pls Delete Me", null,
RavenJObject.FromObject(new { StackTrace = new StackTrace(true) }),
new RavenJObject());
documentStore.Configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.Admin;
using (var server = new HttpServer(documentStore.Configuration, documentStore.DocumentDatabase))
{
server.StartListening();
Process.Start(documentStore.Configuration.ServerUrl); // start the server
do
{
Thread.Sleep(100);
} while (documentStore.DatabaseCommands.Get("Pls Delete Me") != null && (debug == false || Debugger.IsAttached));
}
}
示例2: Main
private static void Main()
{
// Initialize the database and create indexes
var documentStore = new EmbeddableDocumentStore {
UseEmbeddedHttpServer = true,
#if DEBUG
RunInMemory = true
#endif
};
_documentStore = documentStore;
documentStore.SetStudioConfigToAllowSingleDb();
documentStore.Configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.All;
documentStore.Configuration.Settings.Add("Raven/ActiveBundles", "Expiration");
documentStore.Configuration.Settings.Add("Raven/Expiration/DeleteFrequencySeconds", "10");
documentStore.Initialize();
IndexCreation.CreateIndexes(typeof(Program).Assembly, documentStore);
// Set up some pressure gauge simulators at different starting points and speeds
AddPressureGauge("Pressure Gague 1", 30, 10);
AddPressureGauge("Pressure Gague 2", 50, 20);
AddPressureGauge("Pressure Gague 3", 70, 30);
// Set up the polling timer to read the gauges periodically
PollingTimer.Interval = TakeReadingsEvery.TotalMilliseconds;
PollingTimer.Elapsed += PollingTimerElapsed;
PollingTimer.Start();
while (DoMenu())
{
}
PollingTimer.Stop();
PollingTimer.Dispose();
foreach (var sensor in Sensors.Values)
sensor.Dispose();
documentStore.DocumentDatabase.StopBackgroundWorkers();
documentStore.Dispose();
}