private void DataSource_Saved(object sender, FormDataSourceEventArgs e) { if (uSync8BackOffice.eventsPaused) { return; } var attempts = this.Export(e.FormDataSource, Path.Combine(rootFolder, this.DefaultFolder), this.DefaultConfig); foreach (var attempt in attempts.Where(x => x.Success)) { this.CleanUp(e.FormDataSource, attempt.FileName, Path.Combine(rootFolder, this.DefaultFolder)); } }
private void DataSource_Deleted(object sender, FormDataSourceEventArgs e) { if (uSync8BackOffice.eventsPaused || e.FormDataSource == null) { return; } var filename = GetPath(Path.Combine(rootFolder, this.DefaultFolder), e.FormDataSource, DefaultConfig.GuidNames, DefaultConfig.UseFlatStructure); var attempt = serializer.SerializeEmpty(e.FormDataSource, SyncActionType.Delete, string.Empty); if (attempt.Success) { syncFileService.SaveXElement(attempt.Item, filename); this.CleanUp(e.FormDataSource, filename, Path.Combine(rootFolder, DefaultFolder)); } }