コード例 #1
0
        /*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));
        }
コード例 #4
0
 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());
        }
コード例 #7
0
 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);
        }
コード例 #9
0
 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();
            }
        }