protected override void OnInitialize() { base.OnInitialize(); if (this.Manager.Items.ContainsKey("ResourceManager")) { resourceManager = this.Manager.Items["ResourceManager"] as ScriptResourceManager; } }
public void LoadScript(Stream stream, ScriptResourceManager scriptResourceManager, ModInfo modInfo, string fileName) { using (stream) { byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); scriptList.Add(new KeyValuePair <MemoryStream, ScriptInfo>(new MemoryStream(buffer), new ScriptInfo(scriptResourceManager, modInfo, fileName))); } }
/// <summary> /// 获取分页器上分页按钮的翻页脚本 /// </summary> /// <param name="html"></param> /// <param name="isNeedScriptTag">是否要加脚本标签,默认值为true(要加的)</param> /// <returns></returns> public static MvcHtmlString DoPagingPost(this HtmlHelper html, bool isNeedScriptTag = true) { IScriptResourceManager mg = new ScriptResourceManager(); var str = mg.GetScriptResourceContent(DoPagingPostFile); if (isNeedScriptTag) { str = "<script type=\"text/javascript\"> " + str + " </script>"; } return(MvcHtmlString.Create(str)); }
public ScriptInfo(ScriptResourceManager resourceManager, ModInfo modInfo, string fileName) { ResourceManager = resourceManager; ModInfo = modInfo; FileName = fileName; }
public void LoadScript(Stream stream, ScriptResourceManager scriptResourceManager, ModInfo modInfo) { LoadScript(stream, scriptResourceManager, modInfo, null); }
public void LoadScript(Stream stream, ScriptResourceManager scriptResourceManager, string fileName) { LoadScript(stream, scriptResourceManager, null, fileName); }