public object?GetNthMask(int index) { Rank_FieldIndex enu = (Rank_FieldIndex)index; switch (enu) { case Rank_FieldIndex.Number: return(Number); case Rank_FieldIndex.Title: return(Title); case Rank_FieldIndex.Insignia: return(Insignia); default: throw new ArgumentException($"Index is out of range: {index}"); } }
public void SetNthMask(int index, object obj) { Rank_FieldIndex enu = (Rank_FieldIndex)index; switch (enu) { case Rank_FieldIndex.Number: this.Number = (Exception?)obj; break; case Rank_FieldIndex.Title: this.Title = (MaskItem <Exception?, GenderedItem <Exception?>?>?)obj; break; case Rank_FieldIndex.Insignia: this.Insignia = (Exception?)obj; break; default: throw new ArgumentException($"Index is out of range: {index}"); } }
public void SetNthException(int index, Exception ex) { Rank_FieldIndex enu = (Rank_FieldIndex)index; switch (enu) { case Rank_FieldIndex.Number: this.Number = ex; break; case Rank_FieldIndex.Title: this.Title = new MaskItem <Exception?, GenderedItem <Exception?>?>(ex, null); break; case Rank_FieldIndex.Insignia: this.Insignia = ex; break; default: throw new ArgumentException($"Index is out of range: {index}"); } }