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

📄 codeeditorcontrol.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
//SOLVED A DESIGNER SERIALIZATION BUG : <sebastian.faltoni[at]gmail.com>
#region using...

using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;
using Fireball.Drawing.GDI;
using Fireball.Syntax;
using Fireball.Windows.Forms;
using Fireball.Windows.Forms.CodeEditor;
using Fireball.Windows.Forms.CodeEditor.TextDraw;
using Fireball.Timers;
using Fireball.Win32; 

#endregion

namespace Fireball.Windows.Forms
{
	/// <summary>
	/// Syntaxbox control that can be used as a pure text editor or as a code editor when a syntaxfile is used.
	/// </summary>
    [Designer(typeof (CodeEditorDesigner), typeof (IDesigner))]
	public class CodeEditorControl : Widget
	{

		protected internal bool DisableIntelliMouse = false;
		protected internal bool DisableFindForm = false;
		protected internal bool DisableAutoList = false;
		protected internal bool DisableInfoTip = false;
		protected internal bool DisableSplitView = false;
		protected internal bool DisableScrollBars = false;

        public event EventHandler FileNameChanged;
        public event EventHandler FileSavedChanged;

		#region General Declarations

		private IContainer components;
		private ArrayList _Views = null;
		private SyntaxDocument _Document = null;
		private int _TooltipDelay = 240;
		private int _TabSize = 4;
		private int _GutterMarginWidth = 19;
		private int _SmoothScrollSpeed = 2;
		private int _RowPadding = 0;
		private long _ticks = 0; //splitter doubleclick timer
		private bool _ShowWhitespace = false;
		private bool _ShowTabGuides = false;
		private bool _ShowLineNumbers = true;
		private bool _ShowGutterMargin = true;
		private bool _ReadOnly = false;
		private bool _HighLightActiveLine = false;
		private bool _VirtualWhitespace = false;
		private bool _BracketMatching = true;
		private bool _OverWrite = false;
		private bool _ParseOnPaste = false;
		private bool _SmoothScroll = false;
		private bool _AllowBreakPoints = true;
		private bool _LockCursorUpdate = false;
		private Color _BracketBorderColor = Color.DarkBlue;
		private Color _TabGuideColor = ControlPaint.Light(SystemColors.ControlLight);
		private Color _OutlineColor = SystemColors.ControlDark;
		private Color _WhitespaceColor = SystemColors.ControlDark;
		private Color _SeparatorColor = SystemColors.Control;
		private Color _SelectionBackColor = SystemColors.Highlight;
		private Color _SelectionForeColor = SystemColors.HighlightText;
		private Color _InactiveSelectionBackColor = SystemColors.ControlDark;
		private Color _InactiveSelectionForeColor = SystemColors.ControlLight;
		private Color _BreakPointBackColor = Color.DarkRed;
		private Color _BreakPointForeColor = Color.White;
		private Color _BackColor = Color.White;
		private Color _HighLightedLineColor = Color.LightYellow;
		private Color _GutterMarginColor = SystemColors.Control;
		private Color _LineNumberBackColor = SystemColors.Window;
		private Color _LineNumberForeColor = Color.Teal;
		private Color _GutterMarginBorderColor = SystemColors.ControlDark;
		private Color _LineNumberBorderColor = Color.Teal;
		private Color _BracketForeColor = Color.Black;
		private Color _BracketBackColor = Color.LightSteelBlue;
		private Color _ScopeBackColor = Color.Transparent;
		private Color _ScopeIndicatorColor = Color.Transparent;
		private TextDrawType _TextDrawStyle = 0;
		private IndentStyle _Indent = IndentStyle.LastRow;
		private string _FontName = "Courier New";
		private float _FontSize = 10f;
		private EditViewControl _ActiveView = null;
		private KeyboardActionList _KeyboardActions = new KeyboardActionList();


        public static LineMarginRender defaultLineMarginRender = new LineMarginRender();


		private string[] TextBorderStyles = new string[]
			{
				"****** * ******* * ******",
				"+---+| | |+-+-+| | |+---+",
				"+---+

⌨️ 快捷键说明

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