예제 #1
0
파일: Simple.cs 프로젝트: pondyond/db4o
 private void DoBiDirectionalReplication()
 {
     Db4objects.Db4o.IObjectContainer handheld = OpenDb(ConfigureDb4oForReplication(), "handheld.yap");
     StoreSomePilots(handheld);
     Db4objects.Db4o.IObjectContainer desktop = OpenDb(ConfigureDb4oForReplication(), "desktop.yap");
     StoreSomeMorePilots(desktop);
     DisplayContents("Bi-Directional", "Before", handheld, desktop);
     Db4objects.Drs.IReplicationSession replication =
         Db4objects.Drs.Replication.Begin(ProviderFor(handheld), ProviderFor(desktop));
     Db4objects.Db4o.IObjectSet changed = replication.ProviderA().ObjectsChangedSinceLastReplication
                                              ();
     while (changed.HasNext())
     {
         replication.Replicate(changed.Next());
     }
     changed = replication.ProviderB().ObjectsChangedSinceLastReplication();
     while (changed.HasNext())
     {
         replication.Replicate(changed.Next());
     }
     replication.Commit();
     DisplayContents(string.Empty, "After", handheld, desktop);
     CloseDb(handheld);
     CloseDb(desktop);
 }
예제 #2
0
파일: Simple.cs 프로젝트: pondyond/db4o
 private void DisplayContentsOf(string heading, Db4objects.Db4o.IObjectContainer db
                                )
 {
     Sharpen.Runtime.Out.WriteLine(heading);
     Sharpen.Runtime.Out.WriteLine();
     Db4objects.Db4o.IObjectSet result = db.QueryByExample(new Db4objects.Drs.Quickstart.Simple.Pilot());
     ListResult(result);
 }
예제 #3
0
파일: Simple.cs 프로젝트: pondyond/db4o
 public virtual void ListResult(Db4objects.Db4o.IObjectSet result)
 {
     while (result.HasNext())
     {
         Sharpen.Runtime.Out.WriteLine(result.Next());
     }
     Sharpen.Runtime.Out.WriteLine();
 }
예제 #4
0
파일: Simple.cs 프로젝트: pondyond/db4o
 public virtual void DoSelectiveReplication()
 {
     Db4objects.Db4o.IObjectContainer handheld = OpenDb(ConfigureDb4oForReplication(), "handheld.yap");
     StoreSomePilots(handheld);
     Db4objects.Db4o.IObjectContainer desktop = OpenDb(ConfigureDb4oForReplication(), "desktop.yap");
     DisplayContents("Selective Replication", "Before", handheld, desktop);
     Db4objects.Drs.IReplicationSession replication =
         Db4objects.Drs.Replication.Begin(ProviderFor(handheld), ProviderFor(desktop));
     Db4objects.Db4o.IObjectSet changed = replication.ProviderA().ObjectsChangedSinceLastReplication
                                              ();
     while (changed.HasNext())
     {
         Db4objects.Drs.Quickstart.Simple.Pilot p = (Db4objects.Drs.Quickstart.Simple.Pilot
                                                     )changed.Next();
         if (p._name.StartsWith("S"))
         {
             replication.Replicate(p);
         }
     }
     replication.Commit();
     DisplayContents(string.Empty, "After", handheld, desktop);
     CloseDb(handheld);
     CloseDb(desktop);
 }
예제 #5
0
 public IObjectSet(IObjectSet _set)
 {
     set = _set;
 }