Example #1
0
		private void LoadSlides(StorageDirectory storageDirectory)
		{
			foreach (var sizeFolder in storageDirectory.GetLocalFolders())
			{
				var format = SlideFormatEnum.Undefined;
				switch (Path.GetFileName(sizeFolder.LocalPath))
				{
					case "4x3":
						format = SlideFormatEnum.Format4x3;
						break;
					case "16x9":
						format = SlideFormatEnum.Format16x9;
						break;
					case "3x4":
						format = SlideFormatEnum.Format3x4;
						break;
				}
				foreach (var groupFolder in sizeFolder.GetLocalFolders())
					foreach (var slideFolder in groupFolder.GetLocalFolders())
					{
						var slideMaster = new SlideMaster(slideFolder)
						{
							Group = groupFolder.Name,
							Format = format
						};
						slideMaster.Load();
						Slides.Add(slideMaster);
					}
			}
			Slides.Sort(
				(x, y) => x.Group.Equals(y.Group) ? x.Order.CompareTo(y.Order) : WinAPIHelper.StrCmpLogicalW(x.Group, y.Group));
		}
Example #2
0
		private void LoadImages()
		{
			var imageFolder = new StorageDirectory(ResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("DIGITAL"));
			Images.Clear();
			var defaultGroup = new ImageSourceGroup(imageFolder) { Name = "Gallery", Order = -1 };
			defaultGroup.LoadImages();
			if (defaultGroup.Images.Any())
				Images.Add(defaultGroup);

			var additionalImageFolder = new StorageDirectory(ResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("DIGITAL_2"));
			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++;
					}
				}
			}
		}
		public RateCardFolder(StorageDirectory rootFolder)
		{
			_rootFolder = rootFolder;
			RateCards = new List<IRateCardViewer>();
			RateCardContainer = new RateFolderControl();
			RateCardContainer.xtraTabControlRateCards.SelectedPageChanged += SelectRateCard;
		}
		public void Load(StorageDirectory colorListFolder)
		{
			Items.Clear();

			if (!colorListFolder.ExistsLocal()) return;

			foreach (var folder in colorListFolder.GetLocalFolders())
			{
				var files = folder.GetLocalFiles().ToList();

				var colorFolder = new ColorFolder();
				colorFolder.Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(folder.Name);

				var imageFile = files.FirstOrDefault(file => file.Name == "image.png");
				if (imageFile != null)
					colorFolder.Logo = new Bitmap(imageFile.LocalPath);

				var schemaFile = files.FirstOrDefault(file => file.Name == "color_scheme.txt");
				colorFolder.Schema = schemaFile != null ?
				ColorSchema.Parse(File.ReadAllText(schemaFile.LocalPath)) :
				new ColorSchema();


				Items.Add(colorFolder);
			}
		}
		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 virtual void LoadData(StorageDirectory holderAppDataFolder)
		{
			DataFolder = new StorageDirectory(holderAppDataFolder.RelativePathParts.Merge(
				new[]
				{
					"solution_templates",
					Id
				}));
		}
		public TargetCustomersState()
		{
			SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "target customer" }));
			TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "target customer", "templates" }));

			SlideHeader = string.Empty;
			Demo = new List<string>();
			Income = new List<string>();
			Geographic = new List<string>();
		}
		public LeadoffStatementState()
		{
			SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "intro slide" }));
			TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "intro slide", "templates" }));

			ShowStatement1 = true;
			ShowStatement2 = false;
			ShowStatement3 = false;
			SlideHeader = string.Empty;
			Statement1 = string.Empty;
			Statement2 = string.Empty;
			Statement3 = string.Empty;
		}
		public ClientGoalsState()
			: base()
		{
			SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "needs analysis" }));
			TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "needs analysis", "templates" }));

			SlideHeader = string.Empty;
			Goal1 = string.Empty;
			Goal2 = string.Empty;
			Goal3 = string.Empty;
			Goal4 = string.Empty;
			Goal5 = string.Empty;
		}
		public void LoadImages()
		{
			Images.Clear();

			var bigImageFolder = new StorageDirectory(_root.RelativePathParts.Merge(ImageSource.BigImageFolderName));
			if (!bigImageFolder.ExistsLocal()) return;


			foreach (var file in bigImageFolder.GetLocalFiles().Where(file => file.Extension == ImageSource.ImageFileExtension))
			{
				var imageSource = ImageSource.FromFolder(_root, Path.GetFileNameWithoutExtension(file.LocalPath));
				if (imageSource != null)
					Images.Add(imageSource);
			}
		}
Example #11
0
		public CoverState()
		{
			SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "cover" }));
			TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "cover", "templates" }));

			ShowPresentationDate = false;
			AddAsPageOne = true;
			UseGenericCover = false;

			SlideHeader = string.Empty;
			Advertiser = string.Empty;
			DecisionMaker = string.Empty;
			PresentationDate = DateTime.MinValue;
			Quote = new Quote();
		}
Example #12
0
        public async Task <IEnumerable <StorageDirectory> > GetRemoteFolders(Func <string, bool> filter)
        {
            var items = await GetRemoteItems(item => item.IsCollection);

            return(items
                   .Where(item => filter(item.GetName()))
                   .Select(item =>
            {
                var directory = new StorageDirectory(RelativePathParts.Merge(item.GetName()));
                if (!Directory.Exists(directory.LocalPath))
                {
                    Directory.CreateDirectory(directory.LocalPath);
                }
                return directory;
            })
                   .ToList());
        }
		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();
		}
		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" });
		}
Example #15
0
        public IEnumerable <StorageFile> GetLocalFiles(Func <string, bool> filter = null, bool recursive = false)
        {
            if (filter == null)
            {
                filter = item => true;
            }

            var items = new List <StorageFile>();

            if (recursive)
            {
                foreach (var directoryPath in Directory.GetDirectories(LocalPath))
                {
                    var subDirectory = new StorageDirectory(RelativePathParts.Merge(Path.GetFileName(directoryPath)));
                    items.AddRange(subDirectory.GetLocalFiles(filter, true));
                }
            }
            items.AddRange(Directory.GetFiles(LocalPath)
                           .Where(filePath => filter(Path.GetFileName(filePath)))
                           .Select(filePath => new StorageFile(RelativePathParts.Merge(Path.GetFileName(filePath)))));
            return(items);
        }
		public SimpleSummaryState()
		{
			SaveFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "closing summary" }));
			TemplatesFolder = new StorageDirectory(AppProfileManager.Instance.AppSaveFolder.RelativePathParts.Merge(new[] { "closing summary", "templates" }));

			ShowAdvertiser = true;
			ShowDecisionMaker = true;
			ShowPresentationDate = true;
			ShowFlightDates = true;
			ShowMonthly = false;
			ShowTotal = false;

			SlideHeader = string.Empty;
			Advertiser = string.Empty;
			DecisionMaker = string.Empty;
			PresentationDate = DateTime.MinValue;
			FlightDatesStart = DateTime.MinValue;
			FlightDatesEnd = DateTime.MinValue;

			ItemsState = new List<SimpleSummaryItemState>();

			ContractSettings = new ContractSettings();
		}
		public override void LoadData(StorageDirectory holderAppDataFolder)
		{
			base.LoadData(holderAppDataFolder);

			var resourceManager = new ResourceManager();

			AsyncHelper.RunSync(() => resourceManager.Load(DataFolder));

			UsersList.Load(resourceManager.DataUsersFile);
			CoverLists.Load(resourceManager.DataCoverFile);
			ClientGoalsLists.Load(resourceManager.DataClientGoalsFile);
			LeadoffStatementLists.Load(resourceManager.DataLeadoffStatementFile);
			TargetCustomersLists.Load(resourceManager.DataTargetCustomersFile);
			SimpleSummaryLists.Load(resourceManager.DataSimpleSummaryFile);

			CleanslateHeaderLogo = resourceManager.LogoCleanslateHeaderFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoCleanslateHeaderFile.LocalPath)
				: null;
			CleanslateSplashLogo = resourceManager.LogoCleanslateSplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoCleanslateSplashFile.LocalPath)
				: null;
			CoverSplashLogo = resourceManager.LogoCoverSplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoCoverSplashFile.LocalPath)
				: null;
			LeadoffStatementSplashLogo = resourceManager.LogoLeadoffStatementSplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoLeadoffStatementSplashFile.LocalPath)
				: null;
			ClientGoalsSplashLogo = resourceManager.LogoClientGoalsSplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoClientGoalsSplashFile.LocalPath)
				: null;
			TargeCustomersSplashLogo = resourceManager.LogoTargetCustomersSplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoTargetCustomersSplashFile.LocalPath)
				: null;
			SimpleSummarySplashLogo = resourceManager.LogoSimpleSummarySplashFile.ExistsLocal()
				? Image.FromFile(resourceManager.LogoSimpleSummarySplashFile.LocalPath)
				: null;
		}
		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
		}
Example #19
0
		public void Load()
		{
			_themes.Clear();
			var storageDirectory = new StorageDirectory(ResourceManager.Instance.ThemesFolder.RelativePathParts.Merge(PowerPointManager.Instance.SlideSettings.SlideMasterFolder));
			if (!storageDirectory.ExistsLocal()) return;

			LoadApprovedThemes(storageDirectory);

			foreach (var themeFolder in storageDirectory.GetLocalFolders())
			{
				var theme = new Theme(themeFolder);
				theme.Load();
				foreach (var approvedTheme in ApprovedThemes.Where(approvedTheme => approvedTheme.Value.Any(t => t.Equals(theme.Name))))
					theme.ApprovedSlides.Add(approvedTheme.Key);
				_themes.Add(theme);
			}
			_themes.Sort((x, y) => x.Order.CompareTo(y.Order));

			ThemesChanged?.Invoke(this, EventArgs.Empty);
		}
		public ArchiveDirectory(string[] relativePathParts) : base(relativePathParts)
		{
			_parentFoder = GetParentFolder();
		}
Example #21
0
        public static async Task <bool> Exists(string[] relativePathParts, bool checkRemoteToo = false)
        {
            var storageItem = new StorageDirectory(relativePathParts);

            return(await storageItem.Exists(checkRemoteToo));
        }
Example #22
0
 public static async Task CreateSubFolder(string[] relativePathParts, string name, bool remoteToo = false)
 {
     var storageItem = new StorageDirectory(relativePathParts);
     await storageItem.CreateSubFolder(name, remoteToo);
 }
		public void LoadSolutionData(StorageDirectory holderAppDataFolder)
		{
			Solutions.ForEach(s => s.LoadData(holderAppDataFolder));
		}
Example #24
0
		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 });
				}
			}
		}
		public IEnumerable<StorageFile> GetLocalFiles(Func<string, bool> filter = null, bool recursive = false)
		{
			if (filter == null)
				filter = item => true;

			var items = new List<StorageFile>();
			if (recursive)
			{
				foreach (var directoryPath in Directory.GetDirectories(LocalPath))
				{
					var subDirectory = new StorageDirectory(RelativePathParts.Merge(Path.GetFileName(directoryPath)));
					items.AddRange(subDirectory.GetLocalFiles(filter, true));
				}
			}
			items.AddRange(Directory.GetFiles(LocalPath)
					.Where(filePath => filter(Path.GetFileName(filePath)))
					.Select(filePath => new StorageFile(RelativePathParts.Merge(Path.GetFileName(filePath)))));
			return items;
		}
		public RateCardManager(StorageDirectory rootFolder)
		{
			_rootFolder = rootFolder;
			RateCardFolders = new List<RateCardFolder>();
		}
Example #27
0
		public MasterWizard(StorageDirectory sourceDirectory)
		{
			_sourceFolder = sourceDirectory;
			Name = _sourceFolder.Name;
		}
		public ImageSourceGroup(StorageDirectory root)
		{
			_root = root;
			Images = new List<ImageSource>();
		}
		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);

			FavoriteImagesFolder = new StorageDirectory(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				"image_favorites"
			});
			if (!await FavoriteImagesFolder.Exists())
				await StorageDirectory.CreateSubFolder(new[] { FileStorageManager.LocalFilesFolderName }, "image_favorites");

			UserListsFolder = new StorageDirectory(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				"user_lists"
			});
			if (!await UserListsFolder.Exists())
				await StorageDirectory.CreateSubFolder(new[] { FileStorageManager.LocalFilesFolderName }, "user_lists");

			SharedSettingsFile = new StorageFile(new[]
			{
				FileStorageManager.LocalFilesFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"Settings.xml"
			});
			SharedSettingsFile.AllocateParentFolder();

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

			#region Remote
			MasterWizardsFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"Slides"
			});
			await MasterWizardsFolder.Download();

			ThemesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"SellerPointThemes"
			});
			await ThemesFolder.Download();

			LauncherTemplatesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"LauncherTemplates"
			});
			await LauncherTemplatesFolder.Download();

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


			SlideMastersFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"SlidesTab"
			});


			ScheduleSlideTemplatesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"ScheduleBuilders"
			});

			CalendarSlideTemplatesFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"Calendar"
			});

			ArtworkFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"Artwork"
			});

			RateCardFolder = new ArchiveDirectory(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"RateCard"
			});

			DashboardCodeFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"AppSettings",
				"dashboard.xml"
			});
			await DashboardCodeFile.Download();

			DefaultSlideSettingsFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"AppSettings",
				"DefaultSlideSettings.xml"
			});
			await DefaultSlideSettingsFile.Download();

			SlideSizeSettingsFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"AppSettings",
				"SlideSizeSettings.xml"
			});
			await SlideSizeSettingsFile.Download();

			HelpFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"HelpUrls",
				HelpManager.GetFileName()
			});
			await HelpFile.Download();

			HelpBrowserFile = new StorageFile(new[]
			{
				FileStorageManager.IncomingFolderName,
				FileStorageManager.CommonIncomingFolderName,
				"HelpUrls",
				"!Help_Browser.xml"
			});
			await HelpBrowserFile.Download();

			OnlineListsFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Online Strategy.xml"));
			if (await OnlineListsFile.Exists(true))
				await OnlineListsFile.Download();

			DataSimpleSummaryFile = new StorageFile(
				AppProfileManager.Instance.AppDataFolder.RelativePathParts.Merge("Closing Summary.xml"));
			if (await DataSimpleSummaryFile.Exists(true))
				await DataSimpleSummaryFile.Download();
			#endregion
		}
		public static async Task<bool> Exists(string[] relativePathParts, bool checkRemoteToo = false)
		{
			var storageItem = new StorageDirectory(relativePathParts);
			return await storageItem.Exists(checkRemoteToo);
		}
		public static async Task CreateSubFolder(string[] relativePathParts, string name, bool remoteToo = false)
		{
			var storageItem = new StorageDirectory(relativePathParts);
			await storageItem.CreateSubFolder(name, remoteToo);
		}
Example #32
0
 public ArchiveDirectory(string[] relativePathParts) : base(relativePathParts)
 {
     _parentFoder = GetParentFolder();
 }
Example #33
0
		public Theme(StorageDirectory root)
		{
			_root = root;
		}
		public static FormStateHelper Init(Form targetForm, StorageDirectory storagePath, string filePrefix, bool showMaximized)
		{
			return new FormStateHelper(targetForm, storagePath, filePrefix, showMaximized);
		}
		public async Task<IEnumerable<StorageDirectory>> GetRemoteFolders(Func<string, bool> filter)
		{
			var items = await GetRemoteItems(item => item.IsCollection);
			return items
				.Where(item => filter(item.GetName()))
				.Select(item =>
				{
					var directory = new StorageDirectory(RelativePathParts.Merge(item.GetName()));
					if (!Directory.Exists(directory.LocalPath))
						Directory.CreateDirectory(directory.LocalPath);
					return directory;
				})
				.ToList();
		}