public static async Task Initialize() { var instance = new ScreenInfo(QuranApp.NativeProvider.ActualWidth, QuranApp.NativeProvider.ActualHeight, QuranApp.NativeProvider.ScaleFactor); await FileUtils.Initialize(instance); }
public async static Task Initialize(ScreenInfo screenInfo) { if (initialized) return; initialized = true; ScreenInfo = screenInfo; // Initialize directory await MakeQuranDirectory(screenInfo); await MakeQuranDatabaseDirectory(); await MakeQuranAudioDirectory(); // Delete stuck files await DeleteStuckFiles(); }
public QuranAudioTrack(int reciterId, QuranAyah verse, ScreenInfo qsi) { if (verse == null) { throw new ArgumentNullException(nameof(verse)); } if (verse == null || verse.Surah < 1 || verse.Surah > 114) { throw new ArgumentException("Invalid Surah number.", nameof(verse)); } this.ReciterId = reciterId; this.Surah = verse.Surah; this.Ayah = verse.Ayah; this.ScreenInfo = qsi; }
public async static Task Initialize(ScreenInfo screenInfo) { if (initialized) { return; } initialized = true; ScreenInfo = screenInfo; // Initialize directory await MakeQuranDirectory(screenInfo); await MakeQuranDatabaseDirectory(); await MakeQuranAudioDirectory(); // Delete stuck files await DeleteStuckFiles(); }
/// <summary> /// Creates Quran root directory. /// </summary> /// <returns></returns> public async static Task MakeQuranDirectory(ScreenInfo qsi) { if (qsi == null) { throw new ArgumentNullException(nameof(qsi)); } if (BaseFolder == null) { BaseFolder = ApplicationData.Current.LocalFolder; var quranBaseFolder = await BaseFolder.TryGetItemAsync(QuranBase); if (quranBaseFolder == null) { quranBaseFolder = await BaseFolder.CreateFolderAsync(QuranBase); } BaseFolder = quranBaseFolder as StorageFolder; } if (BaseFolder == null) { throw new InvalidOperationException("Unable to create a base folder."); } if (ImageFolder == null) { var imageFolderName = "width" + qsi.GetWidthParam(); var quranBaseFolder = await BaseFolder.TryGetItemAsync(imageFolderName); if (quranBaseFolder == null) { quranBaseFolder = await BaseFolder.CreateFolderAsync(imageFolderName); } ImageFolder = quranBaseFolder as StorageFolder; } if (ImageFolder == null) { throw new InvalidOperationException("Unable to create a base image folder."); } }
/// <summary> /// Creates Quran root directory. /// </summary> /// <returns></returns> public async static Task MakeQuranDirectory(ScreenInfo qsi) { if (qsi == null) { throw new ArgumentNullException(nameof(qsi)); } if (BaseFolder == null) { BaseFolder = ApplicationData.Current.LocalFolder; var quranBaseFolder = await BaseFolder.TryGetItemAsync(QURAN_BASE); if (quranBaseFolder == null) { quranBaseFolder = await BaseFolder.CreateFolderAsync(QURAN_BASE); } BaseFolder = quranBaseFolder as StorageFolder; } if (BaseFolder == null) { throw new InvalidOperationException("Unable to create a base folder."); } if (ImageFolder == null) { var imageFolderName = "width" + qsi.GetWidthParam(); var quranBaseFolder = await BaseFolder.TryGetItemAsync(imageFolderName); if (quranBaseFolder == null) { quranBaseFolder = await BaseFolder.CreateFolderAsync(imageFolderName); } ImageFolder = quranBaseFolder as StorageFolder; } if (ImageFolder == null) { throw new InvalidOperationException("Unable to create a base image folder."); } }