SuperDesign/Source/开发辅助工具/Controls/Highlight/CharacterRange.cs

68 lines
2.2 KiB
C#
Raw Normal View History

#region Using Directives
using System;
using System.Runtime.InteropServices;
#endregion Using Directives
namespace ScintillaNET_FindReplaceDialog
{
/// <summary>
/// Specifies a range of characters. If the cpMin and cpMax members are equal, the range is empty.
/// The range includes everything if cpMin is 0 and cpMax is 1.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public class CharacterRange
{
/// <summary>
/// Character position index immediately preceding the first character in the range.
/// </summary>
public int CpMin { get; set; }=0;
/// <summary>
/// Character position immediately following the last character in the range.
/// </summary>
public int CpMax { get; set; }=0;
/// <summary>
/// 所在行开始的位置
/// </summary>
public int LinePos { get; set; } = -1;
/// <summary>
/// 所在行数
/// </summary>
public int LineNum { get; set; }=-1;
/// <summary>
/// 所在行文本
/// </summary>
public string RangeText { get; set; } ="";
/// <summary>
/// 选择区域是否是空
/// </summary>
/// <returns></returns>
public bool IsEmpty()
{
return CpMin == CpMax;
}
/// <summary>
/// Specifies a range of characters. If the cpMin and cpMax members are equal, the range is empty.
/// The range includes everything if cpMin is 0 and cpMax is 1.
/// </summary>
/// <param name="Min">The minimum, or start position.</param>
/// <param name="Max">The maximum, or end position.</param>
public CharacterRange(int Min, int Max)
{
this.CpMin = Min;
this.CpMax = Max;
}
/// <summary>
/// Specifies a range of characters. If the cpMin and cpMax members are equal, the range is empty.
/// The range includes everything if cpMin is 0 and cpMax is 1.
/// </summary>
/// <param name="Min">The minimum, or start position.</param>
/// <param name="Max">The maximum, or end position.</param>
public CharacterRange()
{
}
}
}