private static bool ClearFolder(BackgroundWorker backgroundWorker) { try { FileMg.DirectoryDelete(FileMg.AutoTmtOutputFileDir, true); FileMg.DeleteTmtCacheFile(FileMg.AutoTmtDataFileDir); } catch { } if (Configures.GetAutoIsDeleteExistingFile()) { OutputMg.OutputHeader1(backgroundWorker, "Step 0", "Clear output folder"); OutputMg.OutputContent(backgroundWorker, "Start to clear"); try { FileMg.ClearAutoFolder(); FileMg.InitDataFolder(); } catch { OutputMg.OutputHeader1(backgroundWorker, "Failed", "Clear folder failed. Please try to run this tool as Administrator."); return(false); } OutputMg.OutputContent(backgroundWorker, "Finished clearing"); } return(true); }
static void Main(string[] args) { FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); typeanalysier test = new typeanalysier(); test.show_result(all_files); }
private void CopyFile_DoWork(object sender, DoWorkEventArgs e) { if (cbIsDelDestFile.Checked) { FileMg.ClearManualFolder(); FileMg.InitDataFolder(); } e.Result = FileMg.DirectoryCopy(tbRawFileFolder.Text, FileMg.ManualSourceFileDir, true, false, backgroundWorker); }
dep_table = dep_table + "\n "; foreach (var elem in item.Value) { dep_table = dep_table + "\n" + item.Key + " depends on " + elem; } dep_table = dep_table + " \n ===================="; } return dep_table; }
//----< Test Stub >-------------------------------------------------- #if (TEST_TypeTable) static void Main(string[] args) { FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); TestParser tp = new TestParser(); TypeTable tb = new TypeTable(); tb = tb.getTypeTable(all_files); tb.show(); }
private static bool ExtractSourceFiles(BackgroundWorker backgroundWorker) { OutputMg.OutputHeader1(backgroundWorker, "Step 2", "Extract Source File"); OutputMg.OutputContent(backgroundWorker, "Start to count number under " + FileMg.AutoSourceFileDir); int sourceFileNumber = FileMg.CountFileNumber(FileMg.AutoSourceFileDir); OutputMg.OutputContent(backgroundWorker, "Finished counting. Total file number is: " + sourceFileNumber); OutputMg.OutputContent(backgroundWorker, "Start to extract files"); ExtractMg.ExtractFile(FileMg.AutoSourceFileDir, FileMg.AutoExtractTextFileDir, FileMg.AutoCleanTextFileDir, FileMg.AutoSemiCleanTextFileDir, FileMg.AutoTmtDataFileDir + Constants.TmtInputFileName, backgroundWorker); OutputMg.OutputContent(backgroundWorker, "Finished extracting files"); return(true); }
static void Main(string[] args) { FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); CsGraph <string, string> test = new CsGraph <string, string>("test"); test.show_strong(all_files).show(); // test.show(); Console.WriteLine("\n\n"); Console.WriteLine("\n----------------------------------------end of test--------------------------------"); }
private void viewHelpToolStripMenuItem_Click(object sender, EventArgs e) { //IExplorerMg.RunIExplorerTool(FileMg.MapRelToAbsFilePath(Constants.HelpPageFilePath)); try { object pageNumber = 1; string filePath = FileMg.MapRelToAbsFilePath(Constants.HelpPageFilePath); Process myProcess = new Process(); myProcess.StartInfo.FileName = "AcroRd32.exe"; myProcess.StartInfo.Arguments = string.Format("/A \"page={0}\" \"{1}\"", pageNumber, filePath); myProcess.Start(); } catch { MessageBox.Show("Failed to open pdf file. We need adobe reader to open the pdf file. Please make sure you have setup Adobe reader."); } }
// This is a test method for testing the requirement 1 public void requirement1() { Console.WriteLine(); Console.WriteLine("This is the requirement 1 test"); Console.WriteLine("Requirement: List all .cs format files in the whole solution"); Console.WriteLine("-----------------------------------------------------------------------"); FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); foreach (var file in all_files) { Console.WriteLine(file); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Conclusion: Meet the requirement 1 !!!!!"); Console.WriteLine("-----------------------------------------------------------------------"); }
// This is a test method for testing the requirement 2 public void requirement2() { Console.WriteLine(); Console.WriteLine("This is the requirement 2 test"); Console.WriteLine("Requirement: Analysis and show any type defined by user"); Console.WriteLine("-----------------------------------------------------------------------"); FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); typeanalysier test = new typeanalysier(); test.show_result(all_files); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Conclusion: Meet the requirement 2 !!!!"); Console.WriteLine("-----------------------------------------------------------------------"); }
private void CopyFile_DoWork(object sender, DoWorkEventArgs e) { try { FileMg.DirectoryDelete(FileMg.AutoTmtOutputFileDir, true); FileMg.DeleteTmtCacheFile(FileMg.AutoTmtDataFileDir); } catch { } if (cbIsDelDestFile.Checked) { FileMg.ClearAutoFolder(); FileMg.InitDataFolder(); } e.Result = FileMg.DirectoryCopy(tbRawFileFolder.Text, FileMg.AutoSourceFileDir, true, false, backgroundWorker); }
// This is a test method for testing the requirement 5 public void requirement5() { Console.WriteLine(); Console.WriteLine("This is the requirement 5 test"); Console.WriteLine("Requirement: Find the strong connected component between all files"); Console.WriteLine("-----------------------------------------------------------------------"); FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); CsGraph <string, string> test = new CsGraph <string, string>("test"); test.show_strong(all_files); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Conclusion: Meet the requirement 5 !!!!"); Console.WriteLine("-----------------------------------------------------------------------"); }
private static bool CopyRawFiles(BackgroundWorker backgroundWorker, string dirName) { OutputMg.OutputHeader1(backgroundWorker, "Step 1", "Copy Source File"); try { OutputMg.OutputContent(backgroundWorker, "Start to count number under " + dirName); int sourceFileNumber = FileMg.CountFileNumber(dirName); OutputMg.OutputContent(backgroundWorker, "Finished counting. Total file number is: " + sourceFileNumber); OutputMg.OutputContent(backgroundWorker, "Starting copy files"); int numCopy = FileMg.DirectoryCopy(dirName, FileMg.AutoSourceFileDir, true, false, backgroundWorker); OutputMg.OutputContent(backgroundWorker, "Finished copying files. Total file number is: " + numCopy); return(true); } catch { OutputMg.OutputHeader1(backgroundWorker, "Failed", "Copy files failed. Please try to run this tool as Administrator."); return(false); } }
// This is a test method for testing the requirement 3 public void requirement3() { Console.WriteLine(); Console.WriteLine("This is the requirement 3 test"); Console.WriteLine("Requirement: Make the typetable in the collection of all files"); Console.WriteLine("-----------------------------------------------------------------------"); FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); TypeTable tb = new TypeTable(); tb = tb.getTypeTable(all_files); tb.show(); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Conclusion: Meet the requirement 3 !!!!"); Console.WriteLine("-----------------------------------------------------------------------"); }
// This is a test method for testing the requirement 4 public void requirement4() { Console.WriteLine(); Console.WriteLine("This is the requirement 4 test"); Console.WriteLine("Requirement: Analysis the dependency between all files"); Console.WriteLine("-----------------------------------------------------------------------"); FileMg get_cs = new FileMg(); string[] all_files = get_cs.find_solu_all_cs(get_cs.get_solu_path()); DepAnalysis depana = new DepAnalysis(); depana.match(all_files); depana.show_gra_depent(); depana.show_rela_result(); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Conclusion: Meet the requirement 4 !!!!"); Console.WriteLine("-----------------------------------------------------------------------"); }
private void CountFileNumber_DoWork(object sender, DoWorkEventArgs e) { mSourceFileNumber = FileMg.CountFileNumber(e.Argument.ToString()); e.Result = mSourceFileNumber; }
private void InitializeFolder() { FileMg.InitDataFolder(); }