Ejemplo n.º 1
0
        public List <string> coverFiles(List <string> sourceFiles, List <string> htmFiles)
        {
            List <string> htmFiles2 = new List <string>();
            fileSystem    myFile    = new fileSystem();
            string        tempFile;
            int           count = 0;

            foreach (string htmFile in htmFiles)
            {
                if (htmFile != "")
                {
                    htmFiles2.Add(htmFile);
                }
                else
                {
                    tempFile = Path.GetDirectoryName(sourceFiles[count]) + @"\" + Path.GetFileNameWithoutExtension(sourceFiles[count]) + ".htm";
                    StreamWriter writer = myFile.openToWrite(tempFile);
                    if (writer == null)
                    {
                        continue;
                    }
                    else
                    {
                        myFile.closeWriteFile(writer);
                        htmFiles2.Add(tempFile);
                    }
                }
                count++;
            }

            return(htmFiles2);
        }
 public List<string> preCreate(List<string> sourceFiles) 
 {
     string htmFile;
     List<string> htmFiles = new List<string>();
     fileSystem myFile = new fileSystem();
     foreach (string file in sourceFiles) {
         StreamReader reader = myFile.openToRead(file);
         if (reader == null) continue;
         myFile.closeReadFile(reader);
         
         htmFile =Path.GetDirectoryName(file)+@"\"+ Path.GetFileNameWithoutExtension(file) + ".htm";
         if (!myFile.ifExist(htmFile))
         {
             //Console.WriteLine("processing {0}", htmFile);
             StreamWriter writer = myFile.openToWrite(htmFile);
             if (writer == null)
             {
                 Console.WriteLine("writer is null");
                 continue;
             }
             else
             {
                 myFile.closeWriteFile(writer);
                 htmFiles.Add(htmFile);
             }
         }
         else {
             htmFile = "";
             htmFiles.Add(htmFile);
         }
     }
     return htmFiles;
 }
Ejemplo n.º 3
0
        public List <string> preCreate(List <string> sourceFiles)
        {
            //int i = ITesting.test1;
            cat.Class1.demo();
            string        htmFile;
            List <string> htmFiles = new List <string>();
            fileSystem    myFile   = new fileSystem();

            foreach (string file in sourceFiles)
            {
                StreamReader reader = myFile.openToRead(file);
                if (reader == null)
                {
                    continue;
                }
                myFile.closeReadFile(reader);

                htmFile = Path.GetDirectoryName(file) + @"\" + Path.GetFileNameWithoutExtension(file) + ".htm";
                if (!myFile.ifExist(htmFile))
                {
                    //Console.WriteLine("processing {0}", htmFile);
                    StreamWriter writer = myFile.openToWrite(htmFile);
                    if (writer == null)
                    {
                        Console.WriteLine("writer is null");
                        continue;
                    }
                    else
                    {
                        myFile.closeWriteFile(writer);
                        htmFiles.Add(htmFile);
                    }
                }
                else
                {
                    htmFile = "";
                    htmFiles.Add(htmFile);
                }
            }
            return(htmFiles);
        }
        public List<string> coverFiles(List<string> sourceFiles, List<string> htmFiles) 
        {
            List<string> htmFiles2 = new List<string>();
            fileSystem myFile = new fileSystem();
            string tempFile;
            int count = 0;

            foreach (string htmFile in htmFiles) {
                if (htmFile != "") htmFiles2.Add(htmFile);
                else {
                    tempFile = Path.GetDirectoryName(sourceFiles[count]) + @"\" + Path.GetFileNameWithoutExtension(sourceFiles[count]) + ".htm";
                    StreamWriter writer = myFile.openToWrite(tempFile);
                    if (writer == null) continue;
                    else
                    {
                        myFile.closeWriteFile(writer);
                        htmFiles2.Add(tempFile);
                    }
                }
                count++;
            }

            return htmFiles2;
        }
        public List<string> renameFiles(List<string> sourceFiles, List<string> htmFiles) 
        {
            List<string> htmFiles2 = new List<string>();
            int count = 0;
            fileSystem myFile = new fileSystem();
            string tempFile;
            string time;

            foreach (string htmFile in htmFiles) { 
                if (htmFile != "") htmFiles2.Add(htmFile);
                else
                {
                    time = DateTime.Now.ToString("T").Replace(":","0");
                    tempFile = Path.GetDirectoryName(sourceFiles[count]) + @"\" + Path.GetFileNameWithoutExtension(sourceFiles[count])+time+ ".htm";
                    StreamWriter writer = myFile.openToWrite(tempFile);
                    if (writer == null) continue;
                    else
                    {
                        myFile.closeWriteFile(writer);
                        htmFiles2.Add(tempFile);
                    }
                }
                count++;
            }

            return htmFiles2;
        }