Esempio n. 1
0
        /// <summary>
        /// HTMLへ変換
        /// </summary>
        /// <param name="srcData">変換元データ</param>
        /// <returns></returns>
        public string[] Parse(DirectoryAnalyzeData srcData, bool isAllData)
        {
            List<string> parseData = new List<string>();

            if (isAllData == true)
            {
                string path = srcData.FullName;
                parseData.Add("<a name='" + path.Replace('\\', '/') + "'>");
                parseData.Add(path);
                parseData.Add("</a>");
                parseData.Add("<table border='1px'>");

                List<string> header = new List<string>();

                foreach (FolderWatcherSetting.FileItemKind fileItem in FolderWatcherSetting.Instance.FileItemList)
                {
                    header.Add(FolderWatcherSetting.GetString(fileItem));
                }
                parseData.Add(Parse(header, null, " bgcolor='#cccccc'"));

                // 内部フォルダ
                foreach (DirectoryAnalyzeData data in srcData.SubDirectoryData)
                {
                    parseData.AddRange(Parse(data, false));
                }

                // 内部ファイル
                foreach (DirectoryAnalyzeData data in srcData.FileData)
                {
                    parseData.AddRange(Parse(data, false));
                }
                parseData.Add("</table>");
                parseData.Add("<br>");

                foreach (DirectoryAnalyzeData data in srcData.SubDirectoryData)
                {
                    parseData.AddRange(Parse(data, isAllData));
                }
            }
            else
            {
                parseData.Add(Parse(srcData.ToArray(FolderWatcherSetting.Instance.FileItemList), srcData, string.Empty));
            }

            return parseData.ToArray();
        }
Esempio n. 2
0
        /// <summary>
        /// 文字列配列のデータをCSV形式に変換を行います。
        /// </summary>
        /// <param name="srcData">変換元のデータ</param>
        public string[] Parse(DirectoryAnalyzeData srcData, bool isAllData)
        {
            List<string> parseData = new List<string>();

            parseData.Add(Parse(srcData.ToArray(FolderWatcherSetting.Instance.FileItemList)));

            if (isAllData == true)
            {
                foreach (DirectoryAnalyzeData data in srcData.SubDirectoryData)
                {
                    parseData.AddRange(Parse(data, isAllData));
                }

                foreach (DirectoryAnalyzeData data in srcData.FileData)
                {
                    parseData.AddRange(Parse(data, isAllData));
                }
            }

            return parseData.ToArray();
        }