/*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();
        }
예제 #2
0
파일: Editor.cs 프로젝트: djlw78/FlaxAPI
        internal void RegisterModule(EditorModule module)
        {
            Log("Register Editor module " + module);

            _modules.Add(module);
            if (_isAfterInit)
            {
                _modules.Sort((a, b) => a.InitOrder - b.InitOrder);
            }
        }
예제 #3
0
        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);
 }
예제 #5
0
        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);
        }
예제 #6
0
        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;
         }
     }
 }
예제 #8
0
        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();
 }
예제 #10
0
        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;
        }
예제 #11
0
        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"));
        }
예제 #12
0
        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>"));
        }
예제 #13
0
 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;
     }
 }
예제 #14
0
        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();
            }
        }