private void AddCode(CodedValue code) { if (code != null) { Codes.Add(code); } }
private void ValidateItem(CodedValue item) { if (item == null) { throw new ArgumentNullException("item"); } }
public void AddIfDoesNotExist(CodedValue item) { ValidateItem(item); if (!Contains(item)) { m_items.Add(item); } }
public CodableValue(string text, CodedValue code) { if (text == null) { throw new ArgumentException("text"); } Text = text; AddCode(code); }
public CodableValue(string text, CodedValue code) { if (string.IsNullOrEmpty(text)) { throw new ArgumentException("text"); } Text = text; AddCode(code); }
public void Replace(string newText, CodedValue newCode) { if (string.IsNullOrEmpty(newText)) { throw new ArgumentException("newText"); } Text = newText; ClearCodes(); AddCode(newCode); }
public CodedValue(CodedValue source) : this() { if (source == null) { throw new ArgumentNullException("source"); } Code = source.Code; VocabFamily = source.VocabFamily; VocabName = source.VocabName; VocabVersion = source.VocabVersion; }
public StructuredNameValue(CodedValue name, StructuredMeasurement measurement) { if (name == null) { throw new ArgumentNullException("name"); } if (measurement == null) { throw new ArgumentNullException("value"); } Name = name; Value = measurement; }
public void Update(string updatedText, CodedValue code) { if (string.IsNullOrEmpty(updatedText)) { throw new ArgumentException("newText"); } if (MatchesText(updatedText)) { // Same text. We'll keep any existing codes that merge in the new code if (code != null) { Codes.AddIfDoesNotExist(code); } } else { // Text is different. Replace(updatedText, code); } }
public void Add(CodedValue item) { ValidateItem(item); m_items.Add(item); }
public void Insert(int index, CodedValue item) { ValidateItem(item); m_items.Insert(index, item); }
public bool Contains(CodedValue item) { return(m_items.Contains(item)); }
public int IndexOf(CodedValue item) { return(m_items.IndexOf(item)); }
public bool Remove(CodedValue item) { return(m_items.Remove(item)); }