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


C# EmbeddableDocumentStore.SetStudioConfigToAllowSingleDb方法代码示例

本文整理汇总了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));
            }
        }
开发者ID:dmitriylyner,项目名称:ServiceControl,代码行数:24,代码来源:TestWithRavenDB.cs

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


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