초기 커밋.
This commit is contained in:
85
DDUtilityApp/TIBRENDEZVOUS/DATA/Subject.cs
Normal file
85
DDUtilityApp/TIBRENDEZVOUS/DATA/Subject.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using JWH;
|
||||
using JWH.DATA;
|
||||
|
||||
namespace DDUtilityApp.TIBRENDEZVOUS.DATA
|
||||
{
|
||||
|
||||
public class Subject : DataTableBase
|
||||
{
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string Value { get; set; } = string.Empty;
|
||||
|
||||
public bool IsChecked { get; set; } = true;
|
||||
|
||||
[ReadOnly(true)]
|
||||
public string Description { get { return $"[{this.Name}] {this.Value}"; } }
|
||||
|
||||
public Subject()
|
||||
{
|
||||
}
|
||||
|
||||
public Subject(string name, string value)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
public Subject(XmlNode node)
|
||||
{
|
||||
try
|
||||
{
|
||||
node.PropertiesCopyAttribute(this);
|
||||
this.Value = node.InnerText;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
XLogger.Instance.Fatal(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public string ToXmlString(string indent = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine($"{indent}<{this.GetType().Name}>{this.Value}</{this.GetType().Name}>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
XLogger.Instance.Fatal(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Value}";
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
Subject other = obj as Subject;
|
||||
if (other == null) return false;
|
||||
|
||||
if (!this.Name.Equals(other.Name)) return false;
|
||||
if (!this.Value.Equals(other.Value)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user