Exemplo n.º 1
0
        private string GetDirectoryFileLocation(
            DirectoryFolders directory)
        {
            string strEnum = directory.ToNameString();

            return(GetDirectoryFolderLocation(directory) + "\\" + strEnum + "_" + DateTime.Now.ToString("yyyy-M-dd") +
                   ".txt");
        }
Exemplo n.º 2
0
        public string GetDirectoryFolderLocation(
            DirectoryFolders directory,
            string sharedApplicationLocation = null)
        {
            string strEnum = directory.ToNameString();

            return((sharedApplicationLocation ?? executingDirectory)
                   + "App_Data\\" + strEnum);
        }
Exemplo n.º 3
0
        public string[] LoadTextFromDirectoryFile(
            DirectoryFolders directory,
            string strFileName    = "",
            int?trailingLineCount = null,
            DateTime dtIdentifier = new DateTime())
        {
            string strFolderLocation =
                GetDirectoryFolderLocation(
                    directory);

            string strFileAndPathName;

            if (!string.IsNullOrEmpty(strFileName))
            {
                strFileAndPathName = strFolderLocation + "\\" + strFileName;
            }
            else
            {
                string strEnum = directory.ToNameString();
                strFileAndPathName = strFolderLocation + "\\" + strEnum + "_" + dtIdentifier.ToString("M-dd-yyyy") +
                                     ".txt";
            }

            if (strFileAndPathName.Contains(".txt") && File.Exists(strFileAndPathName))
            {
                lock (_lock)
                {
                    if (trailingLineCount is null)
                    {
                        return(File.ReadAllLines(strFileAndPathName));
                    }

                    return(File.ReadLines(strFileAndPathName)
                           .Reverse()
                           .Take(trailingLineCount ?? 0)
                           .Reverse()
                           .ToArray());
                }
            }
            throw new FileNotFoundException();
        }
Exemplo n.º 4
0
        private string GetDirectoryFileLocation(DirectoryFolders directory)
        {
            Debug.WriteLine(GetType().FullName + "." + MethodBase.GetCurrentMethod().Name);

            string strEnum = directory.ToNameString();
            return GetDirectoryFolderLocation(directory) + "\\" + strEnum + "_" + DateTime.Now.ToString("M-dd-yyyy") +
                   ".txt";
        }
Exemplo n.º 5
0
        public string[] LoadTextFromDirectoryFile(DirectoryFolders directory, String strFileName = "",
            DateTime dtIdentifier = new DateTime())
        {
            Debug.WriteLine(GetType().FullName + "." + MethodBase.GetCurrentMethod().Name);

            string strFolderLocation = GetDirectoryFolderLocation(directory);

            string strFileAndPathName;

            if (!string.IsNullOrEmpty(strFileName))
                strFileAndPathName = strFolderLocation + "\\" + strFileName;
            else
            {
                string strEnum = directory.ToNameString();
                strFileAndPathName = strFolderLocation + "\\" + strEnum + "_" + dtIdentifier.ToString("M-dd-yyyy") +
                                     ".txt";
            }

            if (strFileAndPathName.Contains(".txt") && File.Exists(strFileAndPathName))
                return File.ReadAllLines(strFileAndPathName);
            throw new FileNotFoundException();
        }
Exemplo n.º 6
0
        public string GetDirectoryFolderLocation(DirectoryFolders directory)
        {
            Debug.WriteLine(GetType().FullName + "." + MethodBase.GetCurrentMethod().Name);

            string strEnum = directory.ToNameString();
            return _strExecutingDirectory + "App_Data\\" + strEnum;
        }