⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 codeeditordesigner.cs

📁 Fireball.CodeEditor is an source code editor control derived from the best compona SyntaxBox Control
💻 CS
字号:
//ORIGINAL LGPL SOURCE CODE FINDED ON COMPONA LGPL SOURCE CODE
using System;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;
using Fireball.Syntax;

namespace Fireball.Windows.Forms.CodeEditor
{
	/// <summary>
	/// Designer for the SyntaxBoxControl
	/// </summary>
	public class CodeEditorDesigner : ControlDesigner
	{
		public CodeEditorDesigner() : base()
		{
		}

		protected ISelectionService SelectionService
		{
			get { return (ISelectionService) this.GetService(typeof (ISelectionService)); }
		}

		protected void OnActivate(object s, EventArgs e)
		{
		}

		protected virtual IDesignerHost DesignerHost
		{
			get { return (IDesignerHost) base.GetService(typeof (IDesignerHost)); }
		}

        public override void InitializeNewComponent(System.Collections.IDictionary defaultValues)
        {
            base.InitializeNewComponent(defaultValues);
            if (DesignerHost != null)
            {
                DesignerTransaction trans = DesignerHost.CreateTransaction("Adding Syntaxdocument");
                SyntaxDocument sd = DesignerHost.CreateComponent(typeof(SyntaxDocument)) as SyntaxDocument;

                CodeEditorControl sb = this.Control as CodeEditorControl;
                sb.Document = sd;
                trans.Commit();
            }
        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -