SuperDesign/Source/开发辅助工具/Controls/Highlight/CharacterRange.cs
鑫Intel 03bcb8c5fd ### 2023-02-21更新
------
#### SuperDesign    V3.0.2302.2101
- *.[新增]全新文本编辑器,支持高亮、FTP查看和编辑、目录浏览,历史版本等众多功能。
2023-02-21 09:46:13 +08:00

68 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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()
{
}
}
}