Пример #1
0
		public NotificationManager(ISettingsController aSettingsController){
			theCouchClient = new CouchClient(aSettingsController.Host, aSettingsController.Port, aSettingsController.Username, aSettingsController.Password);
			theCouchDatabase = theCouchClient.GetDatabase(aSettingsController.DatabaseName);
			theOptions = new ChangeOptions();
			theOptions.Heartbeat = 10000;
			theOptions.Since = GetSequence();
		}
Пример #2
0
 public static dynamic RetrieveById(string id)
 {
     var cli = new CouchClient();
     var db = cli.GetDatabase(DBNAME);
     var doc = db.GetDocument<JDocument>(id);
     return doc;
 }
Пример #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            theClient = new CouchClient(Settings.Host, Settings.Port, Settings.Username, Settings.Password);

            theClient.GetDatabase(Settings.DatabaseName, new Result<CouchDatabase>()).WhenDone(
                a => BeginInvoke((MethodInvoker) (() => DatabaseLoaded(a))),
                ErrorManagement.ProcessException
                );
        }
Пример #4
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        var couchClient = new DreamSeat.CouchClient("localhost", 5984);
        couchClient.GetDatabase ("explosions",  new Result<CouchDatabase>()).WhenDone((database) => {
            Console.Out.WriteLine("SUCCESS!");
        }, e => {
            Console.Out.WriteLine ("Failure! :( " +  e.Message);
        });

        var editor = new NoteEditor();

        this.notebook1.Add(editor);
        editor.Show();
    }
Пример #5
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        var couchClient = new DreamSeat.CouchClient("localhost", 5984);

        couchClient.GetDatabase("explosions", new Result <CouchDatabase>()).WhenDone((database) => {
            Console.Out.WriteLine("SUCCESS!");
        }, e => {
            Console.Out.WriteLine("Failure! :( " + e.Message);
        });

        var editor = new NoteEditor();

        this.notebook1.Add(editor);
        editor.Show();
    }
Пример #6
0
 public static JDocument Store(string id, dynamic obj)
 {
     var cli = new CouchClient();
     var db = cli.GetDatabase(DBNAME);
     return db.CreateDocument<JDocument>(obj);
 }