public MainWindow()
 {
     InitializeComponent();
     _manager = new CouchbaseLiteFacade();
     Title    = _manager.GetLocalDbName();
     _manager.StartSyncGateway(hostname: SYNCHOST);
 }
示例#2
0
        static void Main(string[] args)
        {
            var manager = new CouchbaseLiteFacade();

            manager.StartSyncGateway("localhost");
            Console.WriteLine("Manager and Databse Created");


            var properties =
                "{" +
                "\"name\": \"Roi Katz\", " +
                "\"age\": 31," +
                "\"database\" : \"Couchbase\"" +
                "}";

            var docInsertedId = manager.Insert(properties);

            Console.WriteLine("Doc-id: " + docInsertedId);

            var docGet = manager.Get(docInsertedId);

            Console.WriteLine("DocGet");
            Console.WriteLine(docGet);


            var newProperties =
                "{" +
                "\"name\": \"Roi Katz!\", " +
                "\"age\": 32," +
                "\"database\" : \"CB\"" +
                "}";

            var updated = manager.Update(docInsertedId, newProperties);

            Console.WriteLine("DocGet update");
            Console.WriteLine(updated);

            var isDeleted = manager.Delete(docInsertedId);

            Console.WriteLine("Document deleted: {0}", isDeleted ? "Deleted" : "NotDeleted");

            manager.StopSyncGateway();
        }
 private void StartSyncClick(object sender, RoutedEventArgs e)
 {
     _manager.StartSyncGateway(hostname: SYNCHOST, username: ComboName.Text);
 }
示例#4
0
 public MainWindow()
 {
     InitializeComponent();
     _manager = new CouchbaseLiteFacade();
     _manager.StartSyncGateway();
 }