/// <summary>
    /// Loads the providers files.
    /// </summary>
    static internal void LoadProviders()
    {
        const DataFileFolder folder = DataFileFolder.ApplicationDocuments;

        WebProvidersWord        = Globals.CreateOnlineProviders(folder, WebProvidersWordFilePath);
        WebProvidersConcordance = Globals.CreateOnlineProviders(folder, WebProvidersConcordanceFilePath);
        WebProvidersBible       = Globals.CreateOnlineProviders(folder, WebProvidersBibleFilePath);
        WebProvidersParashah    = Globals.CreateOnlineProviders(folder, WebProvidersParashahFilePath);
        WebProvidersCelebration = Globals.CreateOnlineProviders(folder, WebProvidersCelebrationFilePath);
        Globals.LoadWebLinksProviders();
    }
예제 #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 protected DataFile(string filePath, bool showFileNotFound, bool configurable, DataFileFolder folder)
 {
     FilePathDefault  = filePath ?? throw new ArgumentNullException(nameof(filePath));
     ShowFileNotFound = showFileNotFound;
     Configurable     = configurable;
     Folder           = folder;
     FilePath         = folder switch
     {
         DataFileFolder.ApplicationDocuments => FilePathDefault,
         DataFileFolder.ProgramData => filePath.Replace(Globals.DocumentsFolderPath, Globals.ProgramDataFolderPath),
         DataFileFolder.UserHebrewCommon => filePath.Replace(Globals.DocumentsFolderPath, Globals.UserDataCommonFolderPath),
         DataFileFolder.UserApplication => filePath.Replace(Globals.DocumentsFolderPath, Globals.UserDataFolderPath),
         _ => throw new AdvancedNotImplementedException(folder),
     };
     ReLoad();
 }
 /// <summary>
 /// Creates an OnlineProviders instance.
 /// </summary>
 static public OnlineProviders CreateOnlineProviders(DataFileFolder folder, string filePath)
 {
     try
     {
         return(new OnlineProviders(filePath, true, IsDebugExecutable, folder));
     }
     catch (FileNotFoundException)
     {
         DisplayManager.ShowError(SysTranslations.FileNotFound.GetLang(filePath));
         return(null);
     }
     catch (Exception ex)
     {
         DisplayManager.ShowError(SysTranslations.LoadFileError.GetLang(filePath, ex.Message));
         return(null);
     }
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 public OnlineProviders(string filePath, bool showFileNotFound, bool configurable, DataFileFolder folder)
     : base(filePath, showFileNotFound, configurable, folder)
 {
 }