public FSBasedScriptListFile(string filename) : base(filename) { scriptDir = System.IO.Path.GetDirectoryName(filename); string[] scripts = System.IO.File.ReadAllText(filename).Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); NekoKun.Core.Application.Logger.Log("加载脚本索引文件:{0}", filename); foreach (string script in scripts) { string filen = System.IO.Path.Combine(scriptDir, script + ".rb"); if (System.IO.File.Exists(filen)) { FSBasedScriptFile item = new FSBasedScriptFile(filen); this.scripts.Add(item); } else { NekoKun.Core.Application.Logger.Log(" 找不到脚本文件:{0}", filen); this.MakeDirty(); } } if (this.IsDirty) NekoKun.Core.Application.Logger.Log("因为脚本索引文件中存在无效条目,且无效条目未被加载,索引文件脏了。"); }
public FSBasedScriptListFile(string filename) : base(filename) { scriptDir = System.IO.Path.GetDirectoryName(filename); string[] scripts = System.IO.File.ReadAllText(filename).Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); NekoKun.Core.Application.Logger.Log("加载脚本索引文件:{0}", filename); foreach (string script in scripts) { string filen = System.IO.Path.Combine(scriptDir, script + ".rb"); if (System.IO.File.Exists(filen)) { FSBasedScriptFile item = new FSBasedScriptFile(filen); this.scripts.Add(item); } else { NekoKun.Core.Application.Logger.Log(" 找不到脚本文件:{0}", filen); this.MakeDirty(); } } if (this.IsDirty) { NekoKun.Core.Application.Logger.Log("因为脚本索引文件中存在无效条目,且无效条目未被加载,索引文件脏了。"); } }
public override ScriptFile InsertFile(string pageName, int index) { string pathName = GenerateFileName(pageName); FSBasedScriptFile scriptFile = new FSBasedScriptFile(pathName, ""); this.scripts.Insert(index, scriptFile); scriptFile.MakeDirty(); this.MakeDirty(); return(scriptFile); }
public override ScriptFile InsertFile(string pageName, int index) { string pathName = GenerateFileName(pageName); FSBasedScriptFile scriptFile = new FSBasedScriptFile(pathName, ""); this.scripts.Insert(index, scriptFile); scriptFile.MakeDirty(); this.MakeDirty(); return scriptFile; }