public void ExportAllToDisk() { var e = uSyncBackOfficeSettings.Elements; if (e.Templates) { SyncTemplates.SaveAllToDisk(); } if (e.Stylesheets) { SyncStylesheets.SaveAllToDisk(); } if (e.DataTypes) { SyncDataTypes.SaveAllToDisk(); } if (e.DocumentTypes) { SyncContentTypes.SaveAllToDisk(); } if (e.Macros) { SyncMacros.SaveAllToDisk(); } if (e.MediaTypes) { SyncMediaTypes.SaveAllToDisk(); } if (e.Dictionary) { SyncLanguage.SaveAllToDisk(); SyncDictionaryItems.SaveAllToDisk(); } }
public void AttachToEvents() { var e = uSyncBackOfficeSettings.Elements; if (e.Templates) { SyncTemplates.AttachToEvents(); } if (e.Stylesheets) { SyncStylesheets.AttachToEvents(); } if (e.DataTypes) { SyncDataTypes.AttachToEvents(); } if (e.DocumentTypes) { SyncContentTypes.AttachToEvents(); } if (e.Macros) { SyncMacros.AttachToEvents(); } if (e.MediaTypes) { SyncMediaTypes.AttachToEvents(); } if (e.Dictionary) { SyncLanguage.AttachToEvents(); SyncDictionaryItems.AttachToEvents(); } }
public void ImportAllFromDisk() { Stopwatch importStopWatch = new Stopwatch(); importStopWatch.Start(); long start = importStopWatch.ElapsedMilliseconds; LogHelper.Info <uSyncBackOffice>(">>>>>>>> Importing All items from disk"); var e = uSyncBackOfficeSettings.Elements; if (e.Templates) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: Templates"); SyncTemplates.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported Templates ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.Stylesheets) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: Stylesheets"); SyncStylesheets.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported Stylesheets ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.DataTypes) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: DataTypes"); SyncDataTypes.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported DataTypes ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.DocumentTypes) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: DocumentTypes"); SyncContentTypes.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported DocumentTypes ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.Macros) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: Macros"); SyncMacros.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported Macros ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.MediaTypes) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: MediaTypes"); SyncMediaTypes.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported MediaTypes ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } if (e.Dictionary) { start = importStopWatch.ElapsedMilliseconds; LogHelper.Debug <uSyncBackOffice>("Importing: Languages"); SyncLanguage.ImportAllFromDisk(); LogHelper.Debug <uSyncBackOffice>("Importing: Dictionary items"); SyncDictionaryItems.ImportAllFromDisk(); LogHelper.Info <uSyncBackOffice>("Imported Dictionary & Languages ({0} ms)", () => (importStopWatch.ElapsedMilliseconds - start)); } importStopWatch.Stop(); LogHelper.Info <uSyncBackOffice>("<<<<<<<< Import Complete {0} ms", () => importStopWatch.ElapsedMilliseconds); }