/*private void reloadData(Tuple<EditorModule, int, byte[]> Data) * { * Array.Copy(ROMData, Data.Item2, Data.Item3, 0, Data.Item3.Length); //locked from refreshData * }*/ private void openModule(EditorModule opened) { opened.uponOpen(); myModules.Add(opened); this.openEditorList.Items.Add(opened.ToString()); //add name of the object this.openEditorList.ClearSelected(); opened.Show(); }
internal void RegisterModule(EditorModule module) { Log("Register Editor module " + module); _modules.Add(module); if (_isAfterInit) { _modules.Sort((a, b) => a.InitOrder - b.InitOrder); } }
public async Task <ActionResult> Editor(string module) { EditorModule model = await EditorModule.Get(module); if (model == null) { return(Content("不存在该模块,请先创建!")); } return(View(model)); }
public byte[] requestData(EditorModule owner, int offset, int length) { byte[] myData = new byte[length]; lock (myLock) { Array.Copy(ROMData, offset, myData, 0, length); } accessedData.Add(Tuple.Create(owner, offset, myData)); return(myData); }
private void InitControls() { edContent.ToolsFile = ServerPath + "/Styles/BasicTools.xml"; edContent.EditModes = Telerik.Web.UI.EditModes.Design; EditorModule moduleStatistics = new EditorModule(); moduleStatistics.Name = "RadEditorStatistics"; edContent.Modules.Add(moduleStatistics); btnCancel.PostBackUrl = GetUrl(TopicList.PageUrl); }
public ActionResult AboutUs() { string content = string.Empty; using (EditorModule editorModule = new EditorModule()) { content = HttpUtility.HtmlDecode(editorModule.GetContent()); } ViewData["Content"] = content; return(View()); }
public void freeAllFrom(EditorModule target) { for (int i = 0; i < accessedData.Count; i++) { if (accessedData[i].Item1 == target) { accessedData.RemoveAt(i); i--; continue; } } }
protected override void SetControlAttribute(Label label, WebControl editableControl, WebControl readonlyControl) { base.SetControlAttribute(label, editableControl, readonlyControl); editableControl.Width = 300; txtText.ToolsFile = ServerPath + "/Styles/BasicTools.xml"; txtText.EditModes = Telerik.Web.UI.EditModes.Design; EditorModule moduleStatistics = new EditorModule(); moduleStatistics.Name = "RadEditorStatistics"; txtText.Modules.Add(moduleStatistics); }
public void closeModule(EditorModule closed) { freeAllFrom(closed); for (int i = 0; i < myModules.Count; i++) { if (myModules[i] == closed) { myModules.RemoveAt(i); this.openEditorList.Items.RemoveAt(i); break; } } this.openEditorList.ClearSelected(); }
private void InitControls() { edContent.ToolsFile = ServerPath + "/Styles/BasicTools.xml"; edContent.EditModes = Telerik.Web.UI.EditModes.Design; EditorModule moduleStatistics = new EditorModule(); moduleStatistics.Name = "RadEditorStatistics"; edContent.Modules.Add(moduleStatistics); string url = string.Format("{0}?{1}={2}", TopicPage.PageUrl, TopicPage.QryInstanceId, InstanceId); ReturnUrl = GetUrl(url); btnCancel.PostBackUrl = ReturnUrl; }
public ActionResult AboutUs(FormCollection form) { string content = form["contenttext"]; if (form == null) { return(View()); } EditorModule editorModule = new EditorModule(); editorModule.SaveContent(form["contenttext"].ToString()); editorModule.Dispose(); return(RedirectToAction("AboutUs")); }
public async Task <ActionResult> Editor(EditorModule em, EditorLink newModel) { if (em.Links == null) { em.Links = new List <EditorLink>(); } if (newModel != null && !string.IsNullOrEmpty(newModel.Title)) { newModel.CreationDate = DateTime.Now; em.Links.Add(newModel); } em.CreationDate = DateTime.Now; await MongoHelper.Save(em); return(Content("<html><head><script>alert('提交成功!');window.location.href='/?editMode=true'</script></head></html>")); }
private void InitControls() { if (AllowAdd) { divAdd.Visible = true; edContent.ToolsFile = ServerPath + "/Styles/BasicTools.xml"; edContent.EditModes = Telerik.Web.UI.EditModes.Design; EditorModule moduleStatistics = new EditorModule(); moduleStatistics.Name = "RadEditorStatistics"; edContent.Modules.Add(moduleStatistics); } else { divAdd.Visible = false; } }
internal void RegisterModule(EditorModule module) { Log("Register Editor module " + module); _modules.Add(module); if (_isAfterInit) { _modules.Sort((a, b) => a.InitOrder - b.InitOrder); } if (_areModulesInited) { module.OnInit(); } if (_areModulesAfterInitEnd) { module.OnEndInit(); } }