textselection.cs

来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 50 行

CS
50
字号
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
//     <version>$Revision: 1261 $</version>
// </file>

using System;

namespace SearchAndReplace
{
	public class TextSelection
	{
		int offset;
		int length;
		
		public TextSelection(int offset, int length)
		{
			this.offset = offset;
			this.length = length;
		}
		
		public int Length {
			get {
				return length;
			}
			set {
				length = value;
			}
		}
		
		public int Offset {
			get {
				return offset;
			}
			set {
				offset = value;
			}
		}
		
		/// <summary>
		/// Checks whether a position is in a specified range.
		/// </summary>
		public static bool IsInsideRange(int position, int offset, int length)
		{
			return position >= offset && position < offset + length;
		}
	}
}

⌨️ 快捷键说明

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