public async Task Load()
		{
			await Asa.Common.Core.Configuration.ResourceManager.Instance.Load();

			await Asa.Common.Core.Configuration.ResourceManager.Instance.SlideMastersFolder.Download();

			DataUsersFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Users.xml"));
			await DataUsersFile.Download();

			DataCoverFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Add Cover.xml"));
			await DataCoverFile.Download();

			DataClientGoalsFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Needs Analysis.xml"));
			await DataClientGoalsFile.Download();

			DataLeadoffStatementFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Intro Slide.xml"));
			await DataLeadoffStatementFile.Download();

			DataTargetCustomersFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Target Customer.xml"));
			await DataTargetCustomersFile.Download();
		}
		public void Load()
		{
			var files = _root.GetLocalFiles().ToList();

			var titleFile = files.First(file => file.Name == "title.txt");
			Name = File.ReadAllText(titleFile.LocalPath).Trim();

			var toolTipFile = files.FirstOrDefault(file => file.Name == "tip.txt");
			if (toolTipFile != null)
			{
				var tooltipLines = File.ReadAllLines(toolTipFile.LocalPath);
				ToolTipHeader = tooltipLines.ElementAtOrDefault(0)?.Replace("*", "");
				ToolTipBody = tooltipLines.ElementAtOrDefault(1)?.Replace("*", "");
			}

			int tempInt;
			if (Int32.TryParse(Path.GetFileName(_root.LocalPath), out tempInt))
				Order = tempInt;

			LogoFile = files.FirstOrDefault(file => file.Extension == ".png" && !file.Name.Contains("_rbn"));
			if (LogoFile != null)
			{
				Logo = new Bitmap(LogoFile.LocalPath);
				BrowseLogo = Logo.GetThumbnailImage((Logo.Width * 144) / Logo.Height, 144, null, IntPtr.Zero);

				var borderedLogo = Logo.DrawBorder();

				RibbonLogo = borderedLogo.GetThumbnailImage((borderedLogo.Width * 72) / borderedLogo.Height, 72, null, IntPtr.Zero);
				AdBarLogo = borderedLogo.GetThumbnailImage((borderedLogo.Width * 86) / borderedLogo.Height, 86, null, IntPtr.Zero);
			}
			_masterFile = files.FirstOrDefault(file => file.Extension == ".pptx");
		}
		public string GetLauncherTemplatePath()
		{
			var launcherTemplate = new StorageFile(ResourceManager.Instance.LauncherTemplatesFolder.RelativePathParts.Merge(SlideSettings.LauncherTemplateName));
			if (!launcherTemplate.ExistsLocal())
				throw new FileNotFoundException(String.Format("There is no {0} found", launcherTemplate.Name));

			return launcherTemplate.LocalPath;
		}
		private FormStateHelper(Form targetForm, StorageDirectory storagePath, string filePrefix, bool showMaximized)
		{
			_form = targetForm;
			_stateStorageFile = new StorageFile(storagePath.RelativePathParts.Merge(String.Format("{0}-{1}", filePrefix, StorageName)));
			_showMaximized = showMaximized;
			_form.WindowState = FormWindowState.Normal;
			_form.Load += (o, e) => LoadState();
			_form.FormClosed += (o, e) => SaveState();
		}
		public async Task Init()
		{
			_versionFile = new ConfigFile(new[] { IncomingFolderName, AppProfileManager.Instance.AppName, "version.txt" });
			await InitCredentials();
			SiteCredentialsManager.Instance.Init();
			if (Activated)
				await CheckDataSate();
			if (Activated)
				Authorize();
		}
		public void Init()
		{
			SettingsFile = new StorageFile(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"Credentials.xml"
			});
			SettingsFile.AllocateParentFolder();

			Settings = AuthSettings.Load(SettingsFile);
		}
		public void LoadSolutions(StorageFile solutionsConfigurationFile)
		{
			Solutions.Clear();
			if(!solutionsConfigurationFile.ExistsLocal())
				return;
			var document = new XmlDocument();
			document.Load(solutionsConfigurationFile.LocalPath);
			foreach (var solutionNode in document.SelectNodes(@"//Root/Solution").OfType<XmlNode>())
			{
				var solution = BaseSolutionInfo.CreateFromConfig(solutionNode);
				Solutions.Add(solution);
			}

			Solutions.Sort((x,y)=>x.Order.CompareTo(y.Order));
		}
		protected StorageFile GetSaveFile(string fileName = "")
		{
			StorageFile file;
			if (String.IsNullOrEmpty(fileName))
			{
				var now = DateTime.Now;
				fileName = String.Format("{0}-{1}-{2}", FileNamePrefix, now.ToString("MMddyy"), now.ToString("hmmsstt"));
				file = new StorageFile(SaveFolder.RelativePathParts.Merge(String.Format("{0}.xml", fileName)));
			}
			else
				file = new StorageFile(TemplatesFolder.RelativePathParts.Merge(String.Format("{0}.xml", fileName)));

			file.AllocateParentFolder();

			return file;
		}
		public async Task<ScheduleTemplate> GetScheduleTemplate(string name)
		{
			var templateArchiveFile = new StorageFile(
				AppProfileManager.Instance.SharedFolder.RelativePathParts.Merge(
					new[]
					{
						TemplatesFolderName,
						String.Format("{0}.zip", name)
					}));
			if (await templateArchiveFile.Exists(true, true))
			{
				await templateArchiveFile.Download(true);
				var templateEncodedFile = ZipHelper.ExtractFiles(templateArchiveFile.LocalPath).FirstOrDefault();
				return ScheduleTemplate.FromFile(templateEncodedFile);
			}
			throw new FileNotFoundException("Schedule Template not found in cloud");
		}
		public async Task Load(StorageDirectory dataFolder)
		{
			DataUsersFile = new StorageFile(dataFolder.RelativePathParts.Merge("Users.xml"));
			await DataUsersFile.Download();

			DataCoverFile = new StorageFile(dataFolder.RelativePathParts.Merge("Add Cover.xml"));
			await DataCoverFile.Download();

			DataClientGoalsFile = new StorageFile(dataFolder.RelativePathParts.Merge("Needs Analysis.xml"));
			await DataClientGoalsFile.Download();

			DataLeadoffStatementFile = new StorageFile(dataFolder.RelativePathParts.Merge("Intro Slide.xml"));
			await DataLeadoffStatementFile.Download();

			DataTargetCustomersFile = new StorageFile(dataFolder.RelativePathParts.Merge("Target Customer.xml"));
			await DataTargetCustomersFile.Download();

			DataSimpleSummaryFile = new StorageFile(dataFolder.RelativePathParts.Merge("Closing Summary.xml"));
			await DataSimpleSummaryFile.Download();

			var imageResourceFolder = new StorageDirectory(dataFolder.RelativePathParts.Merge("responsive_images"));

			LogoCleanslateHeaderFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_1_header.png"));
			await LogoCleanslateHeaderFile.Download();

			LogoCleanslateSplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_1.png"));
			await LogoCleanslateSplashFile.Download();

			LogoCoverSplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_2.png"));
			await LogoCoverSplashFile.Download();

			LogoLeadoffStatementSplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_3.png"));
			await LogoLeadoffStatementSplashFile.Download();

			LogoClientGoalsSplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_4.png"));
			await LogoClientGoalsSplashFile.Download();

			LogoTargetCustomersSplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_5.png"));
			await LogoTargetCustomersSplashFile.Download();

			LogoSimpleSummarySplashFile = new StorageFile(imageResourceFolder.RelativePathParts.Merge("tab_6.png"));
			await LogoSimpleSummarySplashFile.Download();
		}
		private void LoadSettings()
		{
			Hide = false;
			var settingsFile = new StorageFile(_sourceFolder.RelativePathParts.Merge("Settings.xml"));
			if (!settingsFile.ExistsLocal()) return;
			var document = new XmlDocument();
			try
			{
				document.Load(settingsFile.LocalPath);
				var node = document.SelectSingleNode(@"/settings/hide");
				if (node != null)
				{
					bool tempBool = false;
					if (bool.TryParse(node.InnerText, out tempBool))
						Hide = tempBool;
				}
			}
			catch { }
		}
		public void Load()
		{
			Items.Clear();

			_contentFile = new StorageFile(ResourceManager.Instance.UserListsFolder.RelativePathParts.Merge(DecisionMakersFileName));
			_contentFile.AllocateParentFolder();

			if (!_contentFile.ExistsLocal()) return;
			var document = new XmlDocument();
			document.Load(_contentFile.LocalPath);

			var node = document.SelectSingleNode(@"/DecisionMakers");
			if (node == null) return;
			foreach (XmlNode childeNode in node.ChildNodes)
			{
				if (!Items.Contains(childeNode.InnerText))
					Items.Add(childeNode.InnerText);
			}
		}
Exemple #13
0
		public void Load(StorageFile dataFile)
		{
			var document = new XmlDocument();
			document.Load(dataFile.LocalPath);

			var node = document.SelectSingleNode(@"/Users");
			if (node == null) return;
			foreach (XmlNode childNode in node.ChildNodes)
			{
				if (childNode.Name.Equals("User"))
				{
					var user = new User();
					foreach (XmlAttribute attribute in childNode.Attributes)
					{
						switch (attribute.Name)
						{
							case "Station":
								user.Station = attribute.Value;
								break;
							case "FirstName":
								user.FirstName = attribute.Value;
								break;
							case "LastName":
								user.LastName = attribute.Value;
								break;
							case "Phone":
								user.Phone = attribute.Value;
								break;
							case "Email":
								user.Email = attribute.Value;
								break;
							case "IsAdmin":
								bool tempBool;
								bool.TryParse(attribute.Value, out tempBool);
								user.IsAdmin = tempBool;
								break;
						}
					}
					_users.Add(user);
				}
			}
		}
		public void Load(StorageFile dataFile)
		{
			var document = new XmlDocument();
			document.Load(dataFile.LocalPath);

			var node = document.SelectSingleNode(@"/CoverSlide");
			if (node == null) return;
			foreach (XmlNode childNode in node.ChildNodes)
			{
				switch (childNode.Name)
				{
					case "SlideHeader":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Headers.Add(attribute.Value);
									break;
							}
						}
						break;
					case "Quote":
						var quote = new Quote();
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									quote.Text = attribute.Value;
									break;
								case "Author":
									quote.Author = attribute.Value;
									break;
							}
						}
						Quotes.Add(quote);
						break;
				}
			}
		}
		private void Init(StorageFile settingsFile)
		{
			if (!settingsFile.ExistsLocal()) return;
			var settingsDoc = XDocument.Load(settingsFile.LocalPath);
			foreach (var element in settingsDoc.Descendants("SourceUrl"))
			{
				var name = element.Attribute("Name") != null ? element.Attribute("Name").Value : String.Empty;
				var url = element.Attribute("Url") != null ? element.Attribute("Url").Value : String.Empty;
				var groupId = element.Attribute("GroupId") != null ? element.Attribute("GroupId").Value : String.Empty;
				if (!url.EndsWith("/")) url += "/";
				var sourceUrl = new SourceUrl { Url = url, Name = name, GroupId = groupId };
				SourceUrls.Add(sourceUrl);
			}
			var node = settingsDoc.Descendants("AutoLoad").FirstOrDefault();
			bool temp;
			AutoLoad = node != null && Boolean.TryParse(node.Value, out temp) && temp;

			if (!SourceUrls.Any()) return;
			_isConfigured = true;
		}
		public async Task SaveTemplate(ScheduleTemplate template)
		{
			var templateList = await GetTemplatesList();
			if (!templateList.Items.Any(templateInfo => templateInfo.Name.Equals(template.Name)))
				templateList.Items.Add(template.GetTemplateInfo());

			var templateEncodedFile = Path.Combine(Path.GetTempPath(), String.Format("{0}.json", template.Name));
			File.WriteAllText(templateEncodedFile, template.Serialize());

			var templateArchiveFile = new StorageFile(
				AppProfileManager.Instance.SharedFolder.RelativePathParts.Merge(
					new[]
					{
						TemplatesFolderName,
						String.Format("{0}.zip", template.Name)
					}));
			ZipHelper.CompressFiles(new[] { templateEncodedFile }, templateArchiveFile.LocalPath);
			await templateArchiveFile.Upload();
			await SaveTemplatesList(templateList);
		}
		public void Load(StorageFile dataFile)
		{
			var document = new XmlDocument();
			document.Load(dataFile.LocalPath);

			var node = document.SelectSingleNode(@"/SimpleSummary");
			if (node != null)
			{
				foreach (XmlNode childNode in node.ChildNodes)
				{
					switch (childNode.Name)
					{
						case "SlideHeader":
							foreach (XmlAttribute attribute in childNode.Attributes)
							{
								switch (attribute.Name)
								{
									case "Value":
										if (!string.IsNullOrEmpty(attribute.Value))
											Headers.Add(attribute.Value);
										break;
								}
							}
							break;
						case "Detail":
							foreach (XmlAttribute attribute in childNode.Attributes)
							{
								switch (attribute.Name)
								{
									case "Value":
										if (!string.IsNullOrEmpty(attribute.Value))
											Details.Add(attribute.Value);
										break;
								}
							}
							break;
					}
				}
			}
		}
		public async Task LoadProfile(bool useremoteConnection = true)
		{
			_localAppIdFile = new StorageFile(new[] { String.Format("{0}_app_id.xml", AppName) });

			_appID = Guid.Empty;
			if (File.Exists(_localAppIdFile.LocalPath))
			{
				var document = new XmlDocument();
				document.Load(_localAppIdFile.LocalPath);

				var node = document.SelectSingleNode(@"/AppID");
				if (!string.IsNullOrEmpty(node?.InnerText))
					_appID = new Guid(node.InnerText);
			}

			if (_appID.Equals(Guid.Empty))
				CreateProfile();

			ProfilesRootFolder = new StorageDirectory(new[] { FileStorageManager.OutgoingFolderName, AppName });
			if (!await ProfilesRootFolder.Exists(useremoteConnection))
				await StorageDirectory.CreateSubFolder(new[] { FileStorageManager.OutgoingFolderName }, AppName, useremoteConnection);

			ProfileFolder = new StorageDirectory(ProfilesRootFolder.RelativePathParts.Merge(ProfileName));
			if (!await ProfileFolder.Exists(useremoteConnection))
				await StorageDirectory.CreateSubFolder(ProfilesRootFolder.RelativePathParts, ProfileName, useremoteConnection);

			SharedFolder = new StorageDirectory(ProfilesRootFolder.RelativePathParts.Merge(SharedFolderName));
			if (!await ProfileFolder.Exists(useremoteConnection))
				await StorageDirectory.CreateSubFolder(ProfilesRootFolder.RelativePathParts, SharedFolderName, useremoteConnection);

			UserDataFolder = new StorageDirectory(ProfileFolder.RelativePathParts.Merge(new[] { UserDataFolderName }));
			if (!await UserDataFolder.Exists(useremoteConnection))
				await StorageDirectory.CreateSubFolder(ProfileFolder.RelativePathParts, UserDataFolderName, useremoteConnection);

			AppSaveFolder = new StorageDirectory(ProfileFolder.RelativePathParts.Merge(SavedFilesFolderName));
			if (!await AppSaveFolder.Exists(useremoteConnection))
				await StorageDirectory.CreateSubFolder(ProfileFolder.RelativePathParts, SavedFilesFolderName, useremoteConnection);

			AppDataFolder = new StorageDirectory(new[] { FileStorageManager.IncomingFolderName, AppName, "Data" });
		}
		public void Load(StorageFile dataFile)
		{
			var document = new XmlDocument();
			document.Load(dataFile.LocalPath);

			var node = document.SelectSingleNode(@"/LeadOff");
			if (node == null) return;
			foreach (XmlNode childNode in node.ChildNodes)
			{
				switch (childNode.Name)
				{
					case "SlideHeader":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Headers.Add(attribute.Value);
									break;
							}
						}
						break;
					case "Statement":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Statements.Add(attribute.Value);
									break;
							}
						}
						break;
				}
			}
		}
Exemple #20
0
		public void Load()
		{
			var files = _root.GetLocalFiles().ToList();

			var titleFile = files.First(file => file.Name == "title.txt");
			Name = File.ReadAllText(titleFile.LocalPath).Trim();

			int tempInt;
			if (Int32.TryParse(Path.GetFileName(_root.LocalPath), out tempInt))
				Order = tempInt;

			var bigLogoFile = files.FirstOrDefault(file => file.Name == "preview.png");
			if (bigLogoFile != null)
			{
				Logo = new Bitmap(bigLogoFile.LocalPath);
				BrowseLogo = Logo.GetThumbnailImage(Logo.Width * 144 / Logo.Height, 144, null, IntPtr.Zero);
				var ribbonLogo = Logo.GetThumbnailImage(Logo.Width * 72 / Logo.Height, 72, null, IntPtr.Zero);
				RibbonLogo = ribbonLogo.DrawBorder();
			}

			_themeFile = files.FirstOrDefault(file => file.Extension == ".thmx");

			ApprovedSlides = new List<SlideType>();
		}
		public async Task Load()
		{
			#region Local
			TempFolder = new StorageDirectory(new[]
			{
				"Temp"
			});
			if (!await TempFolder.Exists())
				await StorageDirectory.CreateSubFolder(new string[] { }, "Temp");

			AppSettingsFolder = new StorageDirectory(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				AppProfileManager.Instance.AppName,
			});
			if (!await AppSettingsFolder.Exists())
				await StorageDirectory.CreateSubFolder(new[] { FileStorageManager.LocalFilesFolderName }, AppProfileManager.Instance.AppName);

			AppSettingsFile = new StorageFile(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				AppProfileManager.Instance.AppName,
				"Settings.xml"
			});
			AppSettingsFile.AllocateParentFolder();
			#endregion

			#region Remote
			AppConfigFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"Config.xml"
			});
			await AppConfigFile.Download();

			TabsConfigFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"TabNames.xml"
			});
			await TabsConfigFile.Download();

			WatchedProcessesFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"HideList.xml"
			});
			await WatchedProcessesFile.Download();

			SharedAssembliesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"SharedAssemblies"
			});
			if (await SharedAssembliesFolder.Exists(true))
				await SharedAssembliesFolder.DownloadTo(SharedAssemblyHelper.SharedAssemblyLocationPath);

			SpecialAppsFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"SpecialApps"
			});
			if (await SpecialAppsFolder.Exists(true))
				await SpecialAppsFolder.Download();

			DataFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"Data",
			});

			SyncFilesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"Data",
				"SyncFiles"
			});
			if (await SyncFilesFolder.Exists(true))
				await SyncFilesFolder.Download();

			CloudFilesFolder = new StorageDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"CloudFiles",
			});
			#endregion
		}
		protected override void Init(string configContent)
		{
			base.Init(configContent);
			var path = ConfigHelper.GetValuesRegex("<path>(.*)</path>", configContent).FirstOrDefault();
			_file = new StorageFile(ResourceManager.Instance.CloudFilesFolder.RelativePathParts.Merge(path.Split(Convert.ToChar(@"\"))));
		}
		private void LoadImages()
		{
			Images.Clear();
			var defaultGroup =
				new ImageSourceGroup(
					new StorageDirectory(
						Asa.Common.Core.Configuration.ResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge(String.Format("{0}",
							MediaMetaData.Instance.DataTypeString.ToUpper()))))
				{
					Name = "Gallery",
					Order = -1
				};
			defaultGroup.LoadImages();
			if (defaultGroup.Images.Any())
				Images.Add(defaultGroup);


			var additionalImageFolder =
				new StorageDirectory(
					Asa.Common.Core.Configuration.ResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge(String.Format(
						"{0}_2", MediaMetaData.Instance.DataTypeString.ToUpper())));
			if (additionalImageFolder.ExistsLocal())
			{
				var contentDescriptionFile = new StorageFile(additionalImageFolder.RelativePathParts.Merge("order.txt"));
				if (contentDescriptionFile.ExistsLocal())
				{
					var groupNames = File.ReadAllLines(contentDescriptionFile.LocalPath);
					var groupIndex = 0;
					foreach (var groupName in groupNames)
					{
						if (String.IsNullOrEmpty(groupName)) continue;
						var groupFolder = new StorageDirectory(additionalImageFolder.RelativePathParts.Merge(groupName));
						if (!groupFolder.ExistsLocal()) continue;
						var imageGroup = new ImageSourceGroup(groupFolder);
						imageGroup.LoadImages();
						imageGroup.Name = groupName;
						imageGroup.Order = groupIndex;
						if (!imageGroup.Images.Any()) continue;
						Images.Add(imageGroup);
						groupIndex++;
					}
				}
			}
		}
		private void LoadApprovedThemes(StorageDirectory root)
		{
			var contentFile = new StorageFile(root.RelativePathParts.Merge("ApprovedThemes.xml"));

			ApprovedThemes.Clear();

			if (!contentFile.ExistsLocal()) return;

			var document = new XmlDocument();
			document.Load(contentFile.LocalPath);

			foreach (var slideNode in document.SelectNodes(@"//Root/Slide").OfType<XmlNode>())
			{
				var slideAttribute = slideNode.Attributes["Name"];
				if (slideAttribute == null) continue;
				var slideType = SlideType.None;
				switch (slideAttribute.Value)
				{
					#region Dashboard
					case "Cleanslate":
						slideType = SlideType.Cleanslate;
						break;
					case "Cover":
						slideType = SlideType.Cover;
						break;
					case "Intro":
						slideType = SlideType.LeadoffStatement;
						break;
					case "NeedsAnalysis":
						slideType = SlideType.ClientGoals;
						break;
					case "TargetCustomers":
						slideType = SlideType.TargetCustomers;
						break;
					case "ClosingSummary":
						slideType = SlideType.SimpleSummary;
						break;
					#endregion

					#region TV Schedule
					case "TVScheduleTV":
						slideType = SlideType.TVSchedulePrograms;
						break;
					case "TVScheduleDigital":
						slideType = SlideType.TVScheduleDigital;
						break;
					case "TVScheduleSummary":
						slideType = SlideType.TVScheduleSummary;
						break;

					case "TVOptionsTV":
						slideType = SlideType.TVOptionsPrograms;
						break;
					case "TVOptionsDigital":
						slideType = SlideType.TVOptionsDigital;
						break;
					case "TVOptionsTVSummary":
						slideType = SlideType.TVOptionstSummary;
						break;

					case "TVSnapTV":
						slideType = SlideType.TVSnapshotPrograms;
						break;
					case "TVSnapDigital":
						slideType = SlideType.TVSnapshotDigital;
						break;
					case "TVSnapTVSummary":
						slideType = SlideType.TVSnapshotSummary;
						break;
					#endregion

					#region Radio Schedule
					case "RadioScheduleRadio":
						slideType = SlideType.RadioSchedulePrograms;
						break;
					case "RadioScheduleDigital":
						slideType = SlideType.RadioScheduleDigital;
						break;
					case "RadioScheduleSummary":
						slideType = SlideType.RadioScheduleSummary;
						break;

					case "RadioOptionsRadio":
						slideType = SlideType.RadioOptionsPrograms;
						break;
					case "RadioOptionsDigital":
						slideType = SlideType.RadioOptionsDigital;
						break;
					case "RadioOptionsRadioSummary":
						slideType = SlideType.RadioOptionstSummary;
						break;

					case "RadioSnapRadio":
						slideType = SlideType.RadioSnapshotPrograms;
						break;
					case "RadioSnapDigital":
						slideType = SlideType.RadioSnapshotDigital;
						break;
					case "RadioSnapRadioSummary":
						slideType = SlideType.RadioSnapshotSummary;
						break;
					#endregion

					#region Digital
					case "DigitalPlanner":
						slideType = SlideType.DigitalProducts;
						break;
					case "DigitalWrapup":
						slideType = SlideType.DigitalSummary;
						break;
					case "DigitalPkgA":
						slideType = SlideType.DigitalProductPackage;
						break;
					case "DigitalPkgB":
						slideType = SlideType.DigitalStandalonePackage;
						break;
						#endregion
				}
				if (slideType == SlideType.None) continue;
				foreach (var themeNode in slideNode.SelectNodes("Theme").OfType<XmlNode>())
				{
					if (!ApprovedThemes.ContainsKey(slideType))
						ApprovedThemes.Add(slideType, new List<SlideApprovedThemeInfo>());
					var defaultAttribute = themeNode.Attributes["Default"];
					ApprovedThemes[slideType].Add(new SlideApprovedThemeInfo { ThemName = themeNode.InnerText, IsDefault = defaultAttribute != null });
				}
			}
		}
		private ActivityManager()
		{
			var activityFolder = AppProfileManager.Instance.UserDataFolder;
			_activityFile = new StorageFile(activityFolder.RelativePathParts.Merge(String.Format("{0}.xml", DateTime.Now.ToString("MM-dd-yyyy"))));
		}
		private string GetBasicTemplateFile(IEnumerable<string> fileName)
		{
			var file = new StorageFile(_sourceFolder.RelativePathParts.Merge(new[] { PowerPointManager.Instance.SlideSettings.SlideFolder, "Basic Slides" }).Merge(fileName));
			return file.LocalPath;
		}
		public TabPageManager(StorageFile contentFile)
		{
			_contentFile = contentFile;
			TabPageSettings = new List<TabPageConfig>();
			LoadHelpLinks();
		}
		public async Task Load()
		{
			await Asa.Common.Core.Configuration.ResourceManager.Instance.Load();

			await Asa.Common.Core.Configuration.ResourceManager.Instance.ScheduleSlideTemplatesFolder.Download();
			await Asa.Common.Core.Configuration.ResourceManager.Instance.CalendarSlideTemplatesFolder.Download();
			await Asa.Common.Core.Configuration.ResourceManager.Instance.ArtworkFolder.Download();
			await Asa.Common.Core.Configuration.ResourceManager.Instance.RateCardFolder.Download();

			TabsConfigFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				String.Format("{0}_tab_names.xml",MediaMetaData.Instance.DataTypeString.ToLower())
			});
			await TabsConfigFile.Download();

			Gallery1ConfigFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"Gallery1.xml"
			});
			await Gallery1ConfigFile.Download();

			Gallery2ConfigFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"Gallery2.xml"
			});
			await Gallery2ConfigFile.Download();

			MediaListsFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge(
					String.Format("{0} Strategy.xml", MediaMetaData.Instance.DataTypeString)));
			await MediaListsFile.Download();

			SolutionsConfigFile = new StorageFile(new[]
{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"solution_templates.xml"
			});
			await SolutionsConfigFile.Download();

			MainAppTitleTextFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"AppSettings",
				"app_brand.txt"
			});
			if (await MainAppTitleTextFile.Exists(true))
				await MainAppTitleTextFile.Download();

			ImageResourcesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				AppProfileManager.Instance.AppName,
				"Resources"
			});
			if (await ImageResourcesFolder.Exists(true))
				await ImageResourcesFolder.Download();
		}
		public void Load(StorageFile dataFile)
		{
			var document = new XmlDocument();
			document.Load(dataFile.LocalPath);

			var node = document.SelectSingleNode(@"/TargetCustomers");
			if (node == null) return;
			foreach (XmlNode childNode in node.ChildNodes)
			{
				switch (childNode.Name)
				{
					case "SlideHeader":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Headers.Add(attribute.Value);
									break;
							}
						}
						break;
					case "Demo":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Demos.Add(attribute.Value);
									break;
							}
						}
						break;
					case "HHI":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										HHIs.Add(attribute.Value);
									break;
							}
						}
						break;
					case "Geography":
						foreach (XmlAttribute attribute in childNode.Attributes)
						{
							switch (attribute.Name)
							{
								case "Value":
									if (!string.IsNullOrEmpty(attribute.Value))
										Geographies.Add(attribute.Value);
									break;
							}
						}
						break;
				}
			}
		}
		public GalleryManager(StorageFile settingsFile)
		{
			SourceUrls = new List<SourceUrl>();
			Init(settingsFile);
		}