public static void GenerateWebContent(SalesLibraries.Business.Entities.Wallbin.Persistent.Library sourceLibrary)
		{
			var targetLibrary = new SoapLibrary();
			targetLibrary.ImportData(sourceLibrary);

			var config = new LibraryConfig();
			config.libraryId = sourceLibrary.ExtId.ToString();
			config.LoadData(Configuration.RemoteResourceManager.Instance.ErrorEmailSettingsFile.LocalPath);
			targetLibrary.config = config;

			#region Pages
			var pages = new List<SoapLibraryPage>();
			foreach (var sourcePage in sourceLibrary.Pages)
			{
				var page = new SoapLibraryPage();
				page.ImportData(sourcePage);
				pages.Add(page);
			}
			targetLibrary.pages = pages.ToArray();
			#endregion

			var autoWidgets = new List<SoapAutoWidget>();
			foreach (var sourceAutoWidget in sourceLibrary.Settings.AutoWidgets)
			{
				var autoWidget = new SoapAutoWidget();
				autoWidget.libraryId = sourceLibrary.ExtId.ToString();
				autoWidget.ImportData(sourceAutoWidget);
				autoWidgets.Add(autoWidget);
			}
			targetLibrary.autoWidgets = autoWidgets.ToArray();

			var previewContainers = new List<SoapUniversalPreviewContainer>();
			foreach (var sourcePreviewContainer in sourceLibrary.PreviewContainers)
			{
				var previewContainer = new SoapUniversalPreviewContainer();
				previewContainer.ImportData(sourcePreviewContainer);
				previewContainers.Add(previewContainer);
			}
			targetLibrary.previewContainers = previewContainers.ToArray();

			var jsonString = JsonConvert.SerializeObject(targetLibrary);
			using (var sw = new StreamWriter(Path.Combine(sourceLibrary.Path, Constants.LibrariesJsonFileName), false))
			{
				sw.Write(jsonString);
				sw.Flush();
				sw.Close();
			}

			var xml = new StringBuilder();
			xml.AppendLine("<Library>");
			xml.AppendLine(@"<Identifier>" + sourceLibrary.ExtId + @"</Identifier>");
			xml.AppendLine(@"</Library>");
			using (var sw = new StreamWriter(Path.Combine(sourceLibrary.Path, Constants.ShortLibraryInfoFileName), false))
			{
				sw.Write(xml.ToString());
				sw.Flush();
			}
		}
Example #2
0
 /// <remarks/>
 public void mockLibraryAsync(SoapLibrary library, object userState) {
     if ((this.mockLibraryOperationCompleted == null)) {
         this.mockLibraryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmockLibraryOperationCompleted);
     }
     this.InvokeAsync("mockLibrary", new object[] {
                 library}, this.mockLibraryOperationCompleted, userState);
 }
Example #3
0
 /// <remarks/>
 public void mockLibraryAsync(SoapLibrary library) {
     this.mockLibraryAsync(library, null);
 }
Example #4
0
 public void mockLibrary(SoapLibrary library) {
     this.Invoke("mockLibrary", new object[] {
                 library});
 }