Exemple #1
0
 private void AddCode(CodedValue code)
 {
     if (code != null)
     {
         Codes.Add(code);
     }
 }
Exemple #2
0
 private void ValidateItem(CodedValue item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
 }
Exemple #3
0
 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);
        }
Exemple #5
0
        public CodableValue(string text, CodedValue code)
        {
            if (string.IsNullOrEmpty(text))
            {
                throw new ArgumentException("text");
            }

            Text = text;
            AddCode(code);
        }
Exemple #6
0
        public CodableValue(string text, CodedValue code)
        {
            if (text == null)
            {
                throw new ArgumentException("text");
            }

            Text = text;
            AddCode(code);
        }
Exemple #7
0
        public void Replace(string newText, CodedValue newCode)
        {
            if (string.IsNullOrEmpty(newText))
            {
                throw new ArgumentException("newText");
            }

            Text = newText;
            ClearCodes();
            AddCode(newCode);
        }
Exemple #8
0
 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 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;
        }
Exemple #11
0
        public StructuredNameValue(CodedValue name, StructuredMeasurement measurement)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (measurement == null)
            {
                throw new ArgumentNullException("value");
            }

            Name  = name;
            Value = measurement;
        }
Exemple #12
0
        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);
            }
        }
Exemple #13
0
 public void Add(CodedValue item)
 {
     ValidateItem(item);
     m_items.Add(item);
 }
 private void AddCode(CodedValue code)
 {
     if (code != null)
     {
         Codes.Add(code);
     }
 }
Exemple #15
0
 public void Insert(int index, CodedValue item)
 {
     ValidateItem(item);
     m_items.Insert(index, item);
 }
Exemple #16
0
 public bool Contains(CodedValue item)
 {
     return(m_items.Contains(item));
 }
Exemple #17
0
 public int IndexOf(CodedValue item)
 {
     return(m_items.IndexOf(item));
 }
        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);
            }
        }
Exemple #19
0
 public bool Remove(CodedValue item)
 {
     return(m_items.Remove(item));
 }
        public void Replace(string newText, CodedValue newCode)
        {
            if (string.IsNullOrEmpty(newText))
            {
                throw new ArgumentException("newText");
            }

            Text = newText;
            ClearCodes();
            AddCode(newCode);
        }