62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
#nullable enable
|
|
|
|
namespace UVC.UIToolkit
|
|
{
|
|
/// <summary>
|
|
/// 문자열 속성 데이터 클래스입니다.
|
|
/// UI는 UTKStringPropertyItemView에서 담당합니다.
|
|
/// </summary>
|
|
public class UTKStringPropertyItem : UTKPropertyItemBase<string>
|
|
{
|
|
#region Fields
|
|
private bool _isMultiline = false;
|
|
private int _maxLength = -1;
|
|
#endregion
|
|
|
|
#region Properties
|
|
/// <summary>속성 타입</summary>
|
|
public override UTKPropertyType PropertyType => UTKPropertyType.String;
|
|
|
|
/// <summary>멀티라인 모드 여부</summary>
|
|
public bool IsMultiline
|
|
{
|
|
get => _isMultiline;
|
|
set => _isMultiline = value;
|
|
}
|
|
|
|
/// <summary>최대 문자 길이 (-1 = 무제한)</summary>
|
|
public int MaxLength
|
|
{
|
|
get => _maxLength;
|
|
set => _maxLength = value;
|
|
}
|
|
|
|
/// <summary>액션 버튼 설정 (null이면 버튼 미표시)</summary>
|
|
public UTKButtonItem? ActionButton { get; set; }
|
|
#endregion
|
|
|
|
#region Constructor
|
|
/// <summary>
|
|
/// 문자열 속성을 생성합니다.
|
|
/// </summary>
|
|
/// <param name="id">고유 ID</param>
|
|
/// <param name="name">표시 이름</param>
|
|
/// <param name="initialValue">초기 값</param>
|
|
/// <param name="isMultiline">멀티라인 모드</param>
|
|
/// <param name="maxLength">최대 문자 길이</param>
|
|
/// <param name="isReadOnly">읽기 전용 여부</param>
|
|
/// <param name="showLabel">레이블 표시 여부</param>
|
|
/// <param name="actionButton">액션 버튼</param>
|
|
public UTKStringPropertyItem(string id, string name, string initialValue = "", bool isMultiline = false, int maxLength = -1, bool isReadOnly = false, bool showLabel = true, UTKButtonItem? actionButton = null)
|
|
: base(id, name, initialValue ?? string.Empty)
|
|
{
|
|
_isMultiline = isMultiline;
|
|
_maxLength = maxLength;
|
|
_isReadOnly = isReadOnly;
|
|
_showLabel = showLabel;
|
|
ActionButton = actionButton;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|