| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934 |
-
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Windows.Forms;
- using Dongke.WinForm.Utilities;
- namespace Dongke.WinForm.Controls
- {
- /// <summary>
- /// 标准列表控件
- /// </summary>
- [ToolboxBitmap(typeof(ListBox))]
- public class LstListBox : ListBox, IDKControl, IDataVerifiable, IAsyncControl
- {
- #region 事件声明
- #region HasErrorChanged
- /// <summary>
- /// 当 HasError 属性的值更改时发生。
- /// </summary>
- private static readonly object EventHasErrorChanged = new object();
- /// <summary>
- /// 当 HasError 属性的值更改时发生。
- /// </summary>
- [Description("当 HasError 属性的值更改时发生。"), Category("CustomerEx")]
- public event EventHandler HasErrorChanged
- {
- add
- {
- base.Events.AddHandler(EventHasErrorChanged, value);
- }
- remove
- {
- base.Events.RemoveHandler(EventHasErrorChanged, value);
- }
- }
- #endregion
- #endregion
- #region 成员变量
- /// <summary>
- /// 焦点是否进入控件
- /// </summary>
- private bool _entered = false;
- /// <summary>
- /// 鼠标是否进入控件
- /// </summary>
- private bool _mouseOver = false;
- /// <summary>
- /// 边框颜色
- /// </summary>
- private Color? _borderColor = null;
- /// <summary>
- /// 上次选中项个数
- /// </summary>
- private int _inputCount = -1;
- #endregion
- #region 构造函数
- /// <summary>
- /// 标准列表控件
- /// </summary>
- public LstListBox()
- {
- this.FormattingEnabled = false;
- CommonSetting.InitControls(this);
- }
- #endregion
- #region 属性
- /// <summary>
- /// 获取一个值,该值指示控件是否有输入焦点。
- /// </summary>
- [DefaultValue(false)]
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [EditorBrowsable(EditorBrowsableState.Advanced)]
- public virtual bool Entered
- {
- get
- {
- return this._entered;
- }
- protected set
- {
- if (this._entered != value)
- {
- this._entered = value;
- this.InvalidateBorder();
- }
- }
- }
- /// <summary>
- /// 获取一个值,该值指示鼠标是否在控件上方。
- /// </summary>
- [DefaultValue(false)]
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [EditorBrowsable(EditorBrowsableState.Advanced)]
- public virtual bool MouseOver
- {
- get
- {
- return this._mouseOver;
- }
- protected set
- {
- if (this._mouseOver != value)
- {
- this._mouseOver = value;
- this.InvalidateBorder();
- }
- }
- }
- #endregion
- #region 重写属性
- /// <summary>
- /// 获取或设置在 System.Windows.Forms.ListBox 中选择项所用的方法
- /// </summary>
- public override SelectionMode SelectionMode
- {
- get
- {
- return base.SelectionMode;
- }
- set
- {
- if (value == SelectionMode.None && this._mustInput)
- {
- //value = SelectionMode.One;
- return;
- }
- base.SelectionMode = value;
- }
- }
- /// <summary>
- /// 获取或设置控件中项的高度。
- /// </summary>
- [DefaultValue(12)]
- public override int ItemHeight
- {
- get
- {
- return base.ItemHeight;
- }
- set
- {
- base.ItemHeight = value;
- }
- }
- /// <summary>
- /// 获取或设置控件的数据源
- /// </summary>
- [Description("获取或设置控件的数据源。"), Category("CustomerEx")]
- [DefaultValue(null)]
- [Browsable(true)]
- public new object DataSource
- {
- get
- {
- return base.DataSource;
- }
- set
- {
- base.DataSource = value;
- if (!this._mustInput)
- {
- this.SelectedIndex = -1;
- }
- }
- }
- #endregion
- #region 重写事件
- #region 属性改变
- /// <summary>
- /// 引发 HasErrorChanged 事件
- /// </summary>
- /// <param name="e">包含事件数据的 EventArgs</param>
- protected virtual void OnHasErrorChanged(EventArgs e)
- {
- EventHandler eventHandler = (EventHandler)base.Events[EventHasErrorChanged];
- if (eventHandler != null)
- {
- eventHandler(this, e);
- }
- }
- #endregion
- #region 行为事件
- /// <summary>
- /// 选择项目改变
- /// </summary>
- /// <param name="e"></param>
- protected override void OnSelectedIndexChanged(EventArgs e)
- {
- this.CheckOnSelectedIndexChanged();
- base.OnSelectedIndexChanged(e);
- }
- #endregion
- #region 键盘事件
- /// <summary>
- /// 键盘点击
- /// </summary>
- /// <param name="e"></param>
- protected override void OnKeyDown(KeyEventArgs e)
- {
- base.OnKeyDown(e);
- if (this.SelectedIndex < 1 && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Left))
- {
- this.SelectPrevItem();
- e.Handled = true;
- return;
- }
- if (this.SelectedIndex == this.Items.Count - 1 && (e.KeyCode == Keys.Down || e.KeyCode == Keys.Right))
- {
- this.SelectNextItem();
- e.Handled = true;
- return;
- }
- }
- #endregion
- #region 焦点事件
- /// <summary>
- /// 输入焦点进入控件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnEnter(EventArgs e)
- {
- this.Entered = true;
- base.OnEnter(e);
- }
- /// <summary>
- /// 获得焦点
- /// </summary>
- /// <param name="e"></param>
- protected override void OnGotFocus(EventArgs e)
- {
- base.OnGotFocus(e);
- }
- /// <summary>
- /// 失去焦点
- /// </summary>
- /// <param name="e"></param>
- protected override void OnLostFocus(EventArgs e)
- {
- base.OnLostFocus(e);
- }
- /// <summary>
- /// 输入焦点离开控件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnLeave(EventArgs e)
- {
- base.OnLeave(e);
- //this.Entered = false;
- }
- /// <summary>
- /// 控件正在验证
- /// </summary>
- /// <param name="e"></param>
- protected override void OnValidating(CancelEventArgs e)
- {
- base.OnValidating(e);
- if (this.HasError && !this._canLostFocusOnError)
- {
- e.Cancel = true;
- }
- }
- /// <summary>
- /// 控件完成验证
- /// </summary>
- /// <param name="e"></param>
- protected override void OnValidated(EventArgs e)
- {
- this.Entered = false;
- base.OnValidated(e);
- }
- #endregion
- #region 鼠标事件
- /// <summary>
- /// 鼠标进入控件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnMouseEnter(EventArgs e)
- {
- this.MouseOver = true;
- base.OnMouseEnter(e);
- }
- /// <summary>
- /// 鼠标离开控件
- /// </summary>
- /// <param name="e"></param>
- protected override void OnMouseLeave(EventArgs e)
- {
- base.OnMouseLeave(e);
- this.MouseOver = false;
- }
- /// <summary>
- /// 鼠标移动
- /// </summary>
- /// <param name="e"></param>
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- }
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="e"></param>
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- }
- /// <summary>
- /// 鼠标抬起
- /// </summary>
- /// <param name="e"></param>
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- }
- #endregion
- #endregion
- #region 重写方法
- /// <summary>
- /// 处理 Windows 消息
- /// </summary>
- /// <param name="m">要处理的 Windows System.Windows.Forms.Message</param>
- protected override void WndProc(ref Message m)
- {
- base.WndProc(ref m);
- if (m.Msg == (int)WindowsMessage.WM_PAINT ||
- m.Msg == (int)WindowsMessage.WM_NCPAINT ||
- m.Msg == (int)WindowsMessage.WM_CTLCOLOREDIT)
- {
- //this.WmBorderPaint(ref m);
- BorderColorPaint.WmBorderPaint(this._borderColor, this.Width, this.Height, ref m);
- }
- }
- #endregion
- #region 公有方法
- /// <summary>
- /// 获取指定项的成员属性的值
- /// </summary>
- /// <param name="item">项</param>
- /// <returns>值</returns>
- public virtual object GetItemValue(object item)
- {
- if (this.DataManager != null)
- {
- string dataMember = this.ValueMember;
- if (dataMember == null)
- {
- dataMember = string.Empty;
- }
- int num = dataMember.LastIndexOf(Constant.S_POINT);
- if (num != -1)
- {
- dataMember = dataMember.Substring(num + 1);
- }
- return this.FilterItemOnProperty(item, dataMember);
- }
- return null;
- }
- /// <summary>
- /// 选择下一个Item
- /// </summary>
- /// <param name="clearSelect">是否能选择空</param>
- public void SelectNextItem(bool clearSelect = true)
- {
- int boxItemCount = this.Items.Count;
- if (boxItemCount < 1)
- {
- return;
- }
- int boxSelectedIndex = this.SelectedIndex;
- boxSelectedIndex++;
- if (boxSelectedIndex >= boxItemCount)
- {
- if (this._mustInput || !clearSelect)
- {
- boxSelectedIndex = 0;
- }
- else
- {
- boxSelectedIndex = -1;
- }
- }
- if (boxSelectedIndex < 0)
- {
- this.SelectedIndex = 0;
- this.ClearSelected();
- }
- else
- {
- this.SelectedIndex = boxSelectedIndex;
- }
- }
- /// <summary>
- /// 选择上一个Item
- /// </summary>
- /// <param name="clearSelect">是否能选择空</param>
- public void SelectPrevItem(bool clearSelect = true)
- {
- int boxItemCount = this.Items.Count;
- if (boxItemCount < 1)
- {
- return;
- }
- int boxSelectedIndex = this.SelectedIndex;
- boxSelectedIndex--;
- if (boxSelectedIndex < -1 ||
- ((this._mustInput || !clearSelect) && boxSelectedIndex < 0))
- {
- boxSelectedIndex = boxItemCount - 1;
- }
- if (boxSelectedIndex < 0)
- {
- this.ClearSelected();
- }
- else
- {
- this.SelectedIndex = boxSelectedIndex;
- }
- }
- /*
- /// <summary>
- /// 确定指定的键是常规输入键还是需要预处理的特殊键
- /// </summary>
- /// <param name="keyData">System.Windows.Forms.Keys 值之一。</param>
- /// <returns>如果指定的键是常规输入键,则为 true;否则为 false。</returns>
- public virtual new bool IsInputKey(Keys keyData)
- {
- return base.IsInputKey(keyData);
- }
- /// <summary>
- /// 确定一个字符是否是控件可识别的输入字符
- /// </summary>
- /// <param name="charCode">要测试的字符。</param>
- /// <returns>如果字符应直接发送到控件且不必经过预处理,则为 true;否则为 false。</returns>
- public virtual new bool IsInputChar(char charCode)
- {
- return base.IsInputChar(charCode);
- }
- */
- #endregion
- #region 保护方法
- /*
- /// <summary>
- /// 处理重绘控件边框的 Windows 消息
- /// </summary>
- /// <param name="m"></param>
- protected virtual void WmBorderPaint(Color? borderColor, ref Message m)
- {
- if (borderColor.HasValue)
- {
- IntPtr hDC = WindowsAPI.GetWindowDC(m.HWnd);
- if (hDC.ToInt32() == 0)
- {
- return;
- }
- // 绘制
- using (Pen pen = new Pen(borderColor.Value))
- {
- using (Graphics g = Graphics.FromHdc(hDC))
- {
- g.SmoothingMode = SmoothingMode.AntiAlias;
- g.DrawRectangle(pen, 0, 0, this.Width - 1, this.Height - 1);
- }
- }
- // 释放
- WindowsAPI.ReleaseDC(m.HWnd, hDC);
- }
- }
- */
- #endregion
- #region 私有方法
- /// <summary>
- /// 当SelectedIndexChanged事件发生时,验证Error。
- /// </summary>
- private void CheckOnSelectedIndexChanged()
- {
- if (this._mustInput)
- {
- if (this._inputCount != this.SelectedItems.Count)
- {
- this._inputCount = this.SelectedItems.Count;
- if (this._inputCount > 0)
- {
- this.ClearError();
- }
- else
- {
- if (this.Items.Count > 0)
- {
- this.SetSelected(0, true);
- return;
- }
- this.SetError(true, ControlErrorCode.DKC_0001, this._itemName);
- }
- }
- }
- }
- /// <summary>
- /// 使父控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向父控件发送绘制消息。
- /// </summary>
- private void InvalidateBorder()
- {
- Color? borderColor = BorderColorPaint.GetBorderColor(this as IDataVerifiable, this._entered, this._mouseOver);
- if (borderColor != this._borderColor)
- {
- this._borderColor = borderColor;
- if (this.Parent == null)
- {
- this.Invalidate();
- }
- else
- {
- this.Parent.Invalidate(this.Bounds, true);
- }
- }
- }
- /*
- /// <summary>
- /// 获得边框颜色
- /// </summary>
- /// <returns>边框颜色,无时为null</returns>
- private Color? GetBorderColor()
- {
- if (this._errorAlert != InputErrorAlert.None &&
- this.HasError &&
- (this._errorAlert == InputErrorAlert.Always ||
- (this._errorAlert == InputErrorAlert.Validated && !this.Entered)))
- {
- return Constant.BORDERCOLOR_ERROR;
- }
- if (this._mustInput && this._showMustInputAlert)
- {
- return Constant.BORDERCOLOR_MUSTINPUT_EMPT;
- }
- return null;
- }
- */
- #endregion
- #region 事件处理
- #endregion
- #region IDataVerifiable 成员
- #region 成员变量
- /// <summary>
- /// 显示边框颜色
- /// </summary>
- private bool _showBorderColor = true;
- /// <summary>
- /// 控件的项目名
- /// </summary>
- private string _itemName = null;
- /// <summary>
- /// 控件是否是必须输入项目
- /// </summary>
- private bool _mustInput = false;
- /// <summary>
- /// 控件在验证输入错误时,如何提示
- /// </summary>
- private InputErrorAlert _errorAlert = InputErrorAlert.Validated;
- /// <summary>
- /// 是否显示必须输入项目的提示
- /// </summary>
- private bool _showMustInputAlert = true;
- /// <summary>
- /// 验证不通过时,焦点能否离开
- /// </summary>
- private bool _canLostFocusOnError = true;
- /// <summary>
- /// 验证是否有错误
- /// </summary>
- private bool _hasError = false;
- /// <summary>
- /// 是否自定义错误
- /// </summary>
- private bool _hasCustomerError = false;
- /// <summary>
- /// 错误编码
- /// </summary>
- private ControlErrorCode _errorCode = ControlErrorCode.DKC_0000;
- /// <summary>
- /// 错误消息
- /// </summary>
- private string _errorMessage = null;
- /// <summary>
- /// 自定义错误消息
- /// </summary>
- private string _customerErrorMessage = null;
- #endregion
- #region 属性
- /// <summary>
- /// 获取或设置控件是否显示边框颜色。
- /// </summary>
- [Description("获取或设置控件是否显示边框颜色。"), Category("IDataVerifiable")]
- [DefaultValue(true)]
- public bool ShowBorderColor
- {
- get
- {
- return this._showBorderColor;
- }
- set
- {
- if (this._showBorderColor != value)
- {
- this._showBorderColor = value;
- this.InvalidateBorder();
- }
- }
- }
- /// <summary>
- /// 获取或设置控件的项目名
- /// </summary>
- [Description("获取或设置控件的项目名。"), Category("IDataVerifiable")]
- [DefaultValue(null)]
- public string CDItemName
- {
- get
- {
- return this._itemName;
- }
- set
- {
- this._itemName = value;
- }
- }
- /// <summary>
- /// 获取或设置控件是否必须选中项目。
- /// </summary>
- [Description("获取或设置控件是否必须选中项目。"), Category("IDataVerifiable")]
- [DefaultValue(false)]
- public bool MustInput
- {
- get
- {
- return this._mustInput;
- }
- set
- {
- if (this._mustInput != value)
- {
- this._mustInput = value;
- if (value)
- {
- if (this.SelectionMode == SelectionMode.None)
- {
- this.SelectionMode = SelectionMode.One;
- }
- if (this.SelectedItems.Count == 0 &&
- this.Items.Count > 0)
- {
- this.SetSelected(0, true);
- }
- }
- this.ValidateData();
- if (this._mustInput && this._showMustInputAlert)
- {
- this.InvalidateBorder();
- }
- }
- }
- }
- /// <summary>
- /// 获取或设置控件是否必须选中项目。
- /// </summary>
- [Description("获取或设置控件在验证输入错误时,如何提示。"), Category("IDataVerifiable")]
- [DefaultValue(typeof(InputErrorAlert), "Validated")]
- public InputErrorAlert InputErrorAlert
- {
- get
- {
- return this._errorAlert;
- }
- set
- {
- if (this._errorAlert != value)
- {
- this._errorAlert = value;
- this.InvalidateBorder();
- }
- }
- }
- /// <summary>
- /// 获取或设置控件是否显示必须输入项目提示
- /// </summary>
- [Description("获取或设置控件是否显示必须输入项目提示。"), Category("IDataVerifiable")]
- [DefaultValue(true)]
- public bool ShowMustInputAlert
- {
- get
- {
- return this._showMustInputAlert;
- }
- set
- {
- if (this._showMustInputAlert != value)
- {
- this._showMustInputAlert = value;
- this.InvalidateBorder();
- }
- }
- }
- /// <summary>
- /// 获取或设置当验证不通过时,控件是否可以失去焦点
- /// </summary>
- [Description("获取或设置当验证不通过时,控件是否可以失去焦点。"), Category("IDataVerifiable")]
- [DefaultValue(true)]
- public bool CanLostFocusOnError
- {
- get
- {
- return this._canLostFocusOnError;
- }
- set
- {
- this._canLostFocusOnError = value;
- }
- }
- /// <summary>
- /// 获取控件校验时是否有错误
- /// </summary>
- [Description("获取控件校验时是否有错误。"), Category("IDataVerifiable")]
- [DefaultValue(false)]
- public bool HasError
- {
- get
- {
- return this._hasCustomerError || this._hasError;
- }
- }
- /// <summary>
- /// 获取控件校验时的错误编码
- /// </summary>
- [Description("获取控件校验时的错误编码。"), Category("IDataVerifiable")]
- [DefaultValue(typeof(ControlErrorCode), "DKC_0000")]
- public ControlErrorCode ErrorCode
- {
- get
- {
- return this._hasCustomerError ? ControlErrorCode.DKC_C001 : this._errorCode;
- }
- }
- /// <summary>
- /// 获取控件校验时的错误消息
- /// </summary>
- [Description("获取控件校验时的错误编码。"), Category("IDataVerifiable")]
- [DefaultValue(null)]
- public string ErrorMessage
- {
- get
- {
- return this._hasCustomerError ? this._customerErrorMessage : this._errorMessage;
- }
- }
- #endregion
- #region 公有方法
- /// <summary>
- /// 设置自定义错误
- /// </summary>
- /// <param name="hasError">输入是否有错误</param>
- /// <param name="errorMessage">错误消息</param>
- public virtual void SetCustomerError(bool hasError, string errorMessage)
- {
- if (this._hasCustomerError != hasError ||
- this._customerErrorMessage != errorMessage)
- {
- this._hasCustomerError = hasError;
- this._customerErrorMessage = errorMessage;
- this.OnHasErrorChanged(EventArgs.Empty);
- this.InvalidateBorder();
- }
- }
- /// <summary>
- /// 清除自定义错误
- /// </summary>
- public virtual void ClearCustomerError()
- {
- this.SetCustomerError(false, null);
- }
- /// <summary>
- /// 验证输入内容
- /// </summary>
- /// <returns>验证结果</returns>
- public virtual bool ValidateData()
- {
- if (this._mustInput && this.SelectedItems.Count == 0)
- {
- this.SetError(true, ControlErrorCode.DKC_0001, this._itemName);
- return false;
- }
- this.ClearError();
- return true;
- }
- /// <summary>
- /// 清除输入项
- /// </summary>
- public virtual void ClearValue()
- {
- this.ClearSelected();
- }
- #endregion
- #region 保护方法
- /// <summary>
- /// 设置验证不通过错误
- /// </summary>
- /// <param name="hasError">是否有错误</param>
- /// <param name="code">错误编码</param>
- /// <param name="args">设置格式的对象</param>
- protected void SetError(bool hasError, ControlErrorCode code, params object[] args)
- {
- if (this._hasError != hasError ||
- this._errorCode != code)
- {
- this._hasError = hasError;
- this._errorCode = code;
- if (args != null && args.Length > 0)
- {
- this._errorMessage = string.Format(code.GetDescription(), args);
- }
- else
- {
- this._errorMessage = code.GetDescription();
- }
- this.OnHasErrorChanged(EventArgs.Empty);
- this.InvalidateBorder();
- }
- }
- /// <summary>
- /// 清除验证不通过错误
- /// </summary>
- protected void ClearError()
- {
- this.SetError(false, ControlErrorCode.DKC_0000);
- }
- #endregion
- #endregion
- #region IAsyncControl 成员
- #region 成员变量
- /// <summary>
- /// 异步处理开始时,控件状态
- /// </summary>
- private bool _asyncBeginStatus = false;
- private bool _asyncBeginFocused = false;
- #endregion
- #region 公有方法
- /// <summary>
- /// 开始异步处理
- /// </summary>
- /// <param name="doFocus">是否处理焦点</param>
- public virtual void BeginAsync(ref bool doFocus)
- {
- this._asyncBeginFocused = false;
- if (doFocus && this.Focused)
- {
- this._asyncBeginFocused = true;
- doFocus = false;
- }
- this._asyncBeginStatus = this.Enabled;
- this.Enabled = false;
- }
- /// <summary>
- /// 结束异步处理
- /// </summary>
- public virtual void EndAsync()
- {
- this.Enabled = this._asyncBeginStatus;
- if (this._asyncBeginFocused)
- {
- this.Focus();
- }
- }
- #endregion
- #endregion
- }
- }
|