Files
XRLib/Assets/Scripts/UVC/UIToolkit/Property/Items/UTKDateTimePropertyItem.cs
2026-02-10 20:48:49 +09:00

46 lines
1.6 KiB
C#

#nullable enable
using System;
namespace UVC.UIToolkit
{
/// <summary>
/// 날짜+시간 속성 데이터 클래스입니다.
/// UI는 UTKDateTimePropertyItemView에서 담당합니다.
/// </summary>
public class UTKDateTimePropertyItem : UTKPropertyItemBase<DateTime>
{
#region Fields
private string _dateTimeFormat = "yyyy-MM-dd HH:mm";
#endregion
#region Properties
/// <summary>속성 타입</summary>
public override UTKPropertyType PropertyType => UTKPropertyType.DateTime;
/// <summary>날짜시간 표시 형식</summary>
public string DateTimeFormat
{
get => _dateTimeFormat;
set => _dateTimeFormat = value ?? "yyyy-MM-dd HH:mm";
}
#endregion
#region Constructor
/// <summary>
/// 날짜+시간 속성을 생성합니다.
/// </summary>
/// <param name="id">고유 ID</param>
/// <param name="name">표시 이름</param>
/// <param name="initialValue">초기 값 (default이면 현재 시간)</param>
/// <param name="isReadOnly">읽기 전용 여부</param>
/// <param name="showLabel">라벨 표시 여부</param>
public UTKDateTimePropertyItem(string id, string name, DateTime initialValue = default, bool isReadOnly = false, bool showLabel = true)
: base(id, name, initialValue == default ? DateTime.Now : initialValue)
{
_isReadOnly = isReadOnly;
_showLabel = showLabel;
}
#endregion
}
}