コード例 #1
0
        public static void GetAllAuthorFilePathsContainedInAuthorDirectory()
        {
            var authorFilePaths = DirectoryFileOperationsClass.GetAllFileNamesContainedInAuthorsDirectory
                                      (BookListPropertiesClass.PathToAuthorsDirectory);

            GetAuthorFileNameFromPath(authorFilePaths);
        }
コード例 #2
0
        public static void SetAllFilePaths()
        {
            var fileAuthorNamesList = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(BookListPropertiesClass
                                                                                                    .PathToAuthorsListDirectory, BookListPropertiesClass.NameOfAuthorsListFile);

            BookListPropertiesClass.PathToAuthorsNamesListFile = fileAuthorNamesList;

            var fileSeriesList = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(BookListPropertiesClass
                                                                                               .PathToSereisDirectory, BookListPropertiesClass.NameOfSeriesDirectory);

            BookListPropertiesClass.PathToSereisNamesListFile = fileSeriesList;

            var fileTitlesList = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(BookListPropertiesClass
                                                                                               .PathToTitlesDirectory, BookListPropertiesClass.NameOfTitlesBookListFile);

            BookListPropertiesClass.PathToTitleNamesListFile = fileTitlesList;
        }
コード例 #3
0
        public static bool GetPathToAuthorsDirectory()
        {
            var dirAppData = DirectoryFileOperationsClass.GetPathToSpecialDirectoryAppDataLocal();

            var dirBookList = BookListPropertiesClass.NameOfTopLevelDirectory;

            var dirBooklistPath =
                DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(dirAppData, dirBookList);

            var dirAuthor = BookListPropertiesClass.NameOfAuthorsDirectory;

            var dirAuthorPath = DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(dirBooklistPath,
                                                                                             dirAuthor);

            BookListPropertiesClass.PathToAuthorsDirectory = dirAuthorPath;

            return(Directory.Exists(dirAuthorPath));
        }
コード例 #4
0
        /// <summary>
        /// The GetPathToAuthorsFileNamesList
        /// </summary>
        /// <returns>The <see cref="bool"/></returns>
        public static bool GetPathToAuthorsFileNamesList()
        {
            var dirBookListName    = BookListPropertiesClass.NameOfTopLevelDirectory;
            var dirAuthorListNames = BookListPropertiesClass.NameOfAuthorsListDirectory;

            var dirAppData      = DirectoryFileOperationsClass.GetPathToSpecialDirectoryAppDataLocal();
            var dirTopLevelPath = DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(dirAppData,
                                                                                               dirBookListName);
            var fileAuthorListPath = DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(dirTopLevelPath,
                                                                                                  dirAuthorListNames);

            if (!File.Exists(fileAuthorListPath))
            {
                return(false);
            }

            BookListPropertiesClass.PathToAuthorsNamesListFile = fileAuthorListPath;

            return(true);
        }
コード例 #5
0
        public static void SetAllDirectoryPaths()
        {
            var dirAppData = DirectoryFileOperationsClass.GetPathToSpecialDirectoryAppDataLocal();

            BookListPropertiesClass.PathToAppDataDirectory = dirAppData;

            var dirBookListName = BookListPropertiesClass.NameOfTopLevelDirectory;

            BookListPropertiesClass.PathToTopLevelDirectory =
                DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(dirAppData, dirBookListName);

            var dirAuthorName = BookListPropertiesClass.NameOfAuthorsDirectory;

            BookListPropertiesClass.PathToAuthorsDirectory =
                DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(
                    BookListPropertiesClass.PathToTopLevelDirectory, dirAuthorName);

            var dirAuthorListName = BookListPropertiesClass.NameOfAuthorsListDirectory;

            BookListPropertiesClass.PathToAuthorsListDirectory =
                DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath(
                    BookListPropertiesClass.PathToTopLevelDirectory, dirAuthorListName);

            var dirSeriesName = BookListPropertiesClass.NameOfSeriesDirectory;

            BookListPropertiesClass.PathToSereisDirectory = DirectoryFileOperationsClass.CombineStringsMakeDirectoryPath
                                                                (BookListPropertiesClass.PathToTopLevelDirectory, dirSeriesName);

            var dirTitlesName = BookListPropertiesClass.NameOfTitlesDirectory;

            BookListPropertiesClass.PathToTitlesDirectory = DirectoryFileOperationsClass
                                                            .CombineStringsMakeDirectoryPath(BookListPropertiesClass.PathToTopLevelDirectory, dirTitlesName);

            var dirAuthorTitlesName = BookListPropertiesClass.NameOfTitlesAuthorsDirectory;

            BookListPropertiesClass.PathToTitlesAuthorsDirectory = DirectoryFileOperationsClass
                                                                   .CombineStringsMakeDirectoryPath(BookListPropertiesClass.PathToTopLevelDirectory, dirAuthorTitlesName);
        }