using System; namespace SHARP_CLAS_UI { public class Alarm { public En_Alarm_List Code { get; set; } public string Description { get; set; } public bool Heavy { get; set; } public bool Light { get; set; } public bool Use { get; set; } public Alarm() { this.Heavy = true; this.Light = false; this.Description = string.Empty; this.Use = true; } public Alarm(En_Alarm_List Code) { this.Code = Code; this.Heavy = true; this.Light = false; this.Description = string.Empty; this.Use = true; } public void Set_Heavy(string level) { switch(level.ToUpper()) { case "TRUE": { Heavy = true; Light = false; break; } case "FALSE": { Heavy = false; Light = true; break; } default: { Heavy = true; Light = false; break; } } } public void Set_Heavy(bool check) { this.Heavy = check; this.Light = !check; } public void Set_Light(bool check) { this.Light = check; this.Heavy = !check; } public void Set_Use(string use) { switch(use.ToUpper()) { case "TRUE": { Use = true; break; } case "FALSE": { Use = false; break; } default: { Use = true; break; } } } public void Set_Use(bool check) { this.Use = check; } public void Set_Discription(string description) { Description = description; } public Alarm Clone() { Alarm alarm = new Alarm(); alarm.Code = this.Code; alarm.Heavy = this.Heavy; alarm.Light = this.Light; alarm.Description = this.Description; alarm.Use = this.Use; return alarm; } public bool Equal(Alarm alarm) { if (alarm == null) return false; bool check = true; check &= alarm.Code == this.Code; check &= alarm.Heavy == this.Heavy; check &= alarm.Light == this.Light; check &= alarm.Description == this.Description; check &= alarm.Use == this.Use; return check; } } }