本文整理匯總了C#中System.Logger.Pause方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.Pause方法的具體用法?C# Logger.Pause怎麽用?C# Logger.Pause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Logger
的用法示例。
在下文中一共展示了Logger.Pause方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static void Main(string[] args)
{
string initpath = "./";
string outpath = "../bin/script02.CSLEDll.bytes";
var logger = new Logger();
ScriptEnv.Instance.Reset(logger);
logger.Log_Warn("Begin Script Test.");
string scriptpath = System.IO.Path.GetFullPath(initpath);//需要修改
logger.Log("ScriptPath=" + scriptpath);
logger.Log_Warn("Please Check if the path is correct.Press any key to continue.");
logger.Pause();
string[] filelist = System.IO.Directory.GetFiles(scriptpath, "*.cs", System.IO.SearchOption.AllDirectories);
logger.Log_Warn("got code file:" + filelist.Length);
logger.Log_Warn("BeginTokenParse");
Dictionary<string, IList<CSLE.Token>> project = new Dictionary<string, IList<CSLE.Token>>();
foreach (var f in filelist)
{
string code = System.IO.File.ReadAllText(f);
var tokens = ScriptEnv.Instance.scriptEnv.tokenParser.Parse(code);
var filename = System.IO.Path.GetFileName(f);
project[filename] = tokens;
logger.Log("TokenParse:" + filename + " len:" + code.Length + " token:" + tokens.Count);
}
logger.Log_Warn("TokenParser Finish.");
logger.Log_Warn("BeginCompile");
ScriptEnv.Instance.scriptEnv.Project_Compiler(project, true);
logger.Log_Warn("EndCompile");
using (System.IO.Stream s = System.IO.File.Open(outpath, System.IO.FileMode.Create))
{
ScriptEnv.Instance.scriptEnv.Project_PacketToStream(project, s);
}
logger.Log("Write script.CSLEDll.bytes in:" + outpath);
logger.Log_Warn("Test end.Press any key to exit.");
logger.Pause();
}