예제 #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);
 }