using HotelPms.Client.Blazor.ViewModel; using HotelPms.Share.Util; using System.Text.Json.Serialization; using static HotelPms.Client.Blazor.Models.RoomTypeInputRow; namespace HotelPms.Client.Blazor.Models { public abstract class EditRow : IDisposable { #region ★★★★★ Property ★★★★★ /// /// Guid /// public string ID { get; set; } = string.Empty; /// /// 行の対象項目情報 /// [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public List Cells { get; set; } = new List(); /// /// 現在使っている列 /// public int ActiveCol { get; set; } = 0; /// /// 列の明細を展開かどうか /// public bool ShowDetails { get; set; } = false; #endregion #region ★★★★★ Class Event ★★★★★ public EditRow() { ID = Guid.NewGuid().ToString(); } // Disposable types implement a finalizer. ~EditRow() { Dispose(false); } protected virtual void Dispose(bool disposing) { if (disposing) { // Dispose managed resources } // Free native resources } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion /// /// データ返す /// /// /// public string GetCellText(int index) { return Cells[index].Text; } public void SetCellText(int index, string text) { Cells[index].Text = text; } /// /// 値変更あり /// /// /// public abstract bool IsValueChanged(int index, string inputText); } }