public OpenDatabaseFile ( Action |
||
action | Action |
The action. |
return | void |
public override SyncInfo Initialize(DatabaseInfo info) { if (info == null) throw new ArgumentNullException("info"); var details = info.Details; var parts = details.Url.Split('\n'); _client = new WebDavClient( parts[1], parts[2]); _info = new SyncInfo { Path = parts[0], Modified = details.Modified, HasLocalChanges = details.HasLocalChanges, }; info.OpenDatabaseFile(x => { using (var buffer = new MemoryStream()) { BufferEx.CopyStream(x, buffer); _info.Database = buffer.ToArray(); } }); return _info; }
public static void Update(DatabaseInfo info, Func<DatabaseInfo, bool> queryUpdate, Action<SyncCompleteInfo> report) { if (info == null) throw new ArgumentNullException("info"); if (queryUpdate == null) throw new ArgumentNullException("queryUpdate"); if (report == null) throw new ArgumentNullException("report"); var details = info.Details; var url = new Uri(details.Url); var client = CreateClient(url.UserInfo); var syncInfo = new SyncInfo { Path = url.LocalPath, Modified = details.Modified, HasLocalChanges = details.HasLocalChanges, }; info.OpenDatabaseFile(x => { using (var buffer = new MemoryStream()) { BufferEx.CopyStream(x, buffer); syncInfo.Database = buffer.ToArray(); } }); Synchronize(client, syncInfo, x => { if (queryUpdate(info)) report(x); }); }
public override SyncInfo Initialize(DatabaseInfo info) { if (info == null) throw new ArgumentNullException("info"); var details = info.Details; string id; _client = OneDriveClient .ParsePath(details.Url, out id); _info = new SyncInfo { Path = id, Modified = details.Modified, HasLocalChanges = details.HasLocalChanges, }; info.OpenDatabaseFile(x => { using (var buffer = new MemoryStream()) { BufferEx.CopyStream(x, buffer); _info.Database = buffer.ToArray(); } }); return _info; }
public override SyncInfo Initialize(DatabaseInfo info) { if (info == null) throw new ArgumentNullException("info"); var details = info.Details; var url = new Uri(details.Url); _client = CreateClient(url.UserInfo); _info = new SyncInfo { Path = url.LocalPath, Modified = details.Modified, HasLocalChanges = details.HasLocalChanges, }; info.OpenDatabaseFile(x => { using (var buffer = new MemoryStream()) { BufferEx.CopyStream(x, buffer); _info.Database = buffer.ToArray(); } }); return _info; }