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


C# IDocumentStore.Changes方法代码示例

本文整理汇总了C#中IDocumentStore.Changes方法的典型用法代码示例。如果您正苦于以下问题:C# IDocumentStore.Changes方法的具体用法?C# IDocumentStore.Changes怎么用?C# IDocumentStore.Changes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDocumentStore的用法示例。


在下文中一共展示了IDocumentStore.Changes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Store = new DocumentStore { DefaultDatabase = "Mono", Url = "http://192.168.1.12:8080" }.Initialize();

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.MyButton);
            Store.Changes("Mono").ForAllDocuments().Subscribe(obj => RunOnUiThread(() =>
            {
                var local = FindViewById<Button>(Resource.Id.MyButton);
                local.Text = "changed at: " + DateTime.Now.TimeOfDay;
            }));

            button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:20,代码来源:Activity1.cs

示例2: Main

        private static void Main(string[] args)
        {
            using (_store = new DocumentStore {Url = "http://localhost:8080", DefaultDatabase="Messages"}.Initialize())
            {
                Boostrap(args);

                _store
                    .Changes()
                    .ConnectionStatusChanged +=
                        (sender, a) =>
                            Console.WriteLine("Raven Connection Status Changed to {0}", _store.Changes().Connected); ;

                var sleepingSubscription =
                    _store
                        .Changes()
                        .ForDocument("admin/config")
                        .Subscribe(AdjustSleep);

                var routingSubcription =
                    _store
                        .Changes()
                        .ForDocumentsStartingWith("routing/")
                        .Subscribe(
                            _work,
                            exception => Console.WriteLine("Changes Subscription Error! {0}", exception),
                            () => Console.WriteLine("Changes Subscription Completed Unexpectedly!")
                        );

                while (true)
                {
                    var input = Console.ReadLine();
                    if (string.IsNullOrWhiteSpace(input)) break;

                    var sleep = WorkerSleep > 0 ? 0 : 1000;
                    SetSleep(sleep);
                }
                routingSubcription.Dispose();
                sleepingSubscription.Dispose();
            }
        }
开发者ID:kijanawoodard,项目名称:RavenConf,代码行数:40,代码来源:Program.cs


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