public static GetScripts ( string filter ) : string[] | ||
filter | string | |
Résultat | string[] |
private static string[] GetScripts(string type) { ArrayList list1 = new ArrayList(); ScriptCompiler.GetScripts(list1, Path.Combine(Core.BaseDirectory, "Scripts"), type); return((string[])list1.ToArray(typeof(string))); }
private static CompilerResults CompileVBScripts(bool debug) { int num1; int num2; object[] objArray1; VBCodeProvider provider1 = new VBCodeProvider(); ICodeCompiler compiler1 = provider1.CreateCompiler(); Console.Write("Scripts: Compiling VB.net scripts..."); string[] textArray1 = ScriptCompiler.GetScripts("*.vb"); if (textArray1.Length == 0) { Console.WriteLine("no files found."); return(null); } string text1 = ScriptCompiler.GetUnusedPath("Scripts.VB"); CompilerResults results1 = compiler1.CompileAssemblyFromFileBatch(new CompilerParameters(ScriptCompiler.GetReferenceAssemblies(), text1, true), textArray1); ScriptCompiler.m_AdditionalReferences.Add(text1); if (results1.Errors.Count > 0) { num1 = 0; num2 = 0; foreach (CompilerError error1 in results1.Errors) { if (error1.IsWarning) { ++num2; continue; } ++num1; } if (num1 > 0) { Console.WriteLine("failed ({0} errors, {1} warnings)", num1, num2); } else { Console.WriteLine("done ({0} errors, {1} warnings)", num1, num2); } foreach (CompilerError error2 in results1.Errors) { objArray1 = new object[6]; objArray1[0] = (error2.IsWarning ? "Warning" : "Error"); objArray1[1] = error2.FileName; objArray1[2] = error2.ErrorNumber; objArray1[3] = error2.Line; objArray1[4] = error2.Column; objArray1[5] = error2.ErrorText; Console.WriteLine(" - {0}: {1}: {2}: (line {3}, column {4}) {5}", objArray1); } return(results1); } Console.WriteLine("done (0 errors, 0 warnings)"); return(results1); }
private static void GetScripts(ArrayList list, string path, string type) { string text1; int num1; string[] textArray1 = Directory.GetDirectories(path); for (num1 = 0; (num1 < textArray1.Length); ++num1) { text1 = textArray1[num1]; ScriptCompiler.GetScripts(list, text1, type); } list.AddRange(Directory.GetFiles(path, type)); }