Example #1
0
        /// <summary>
        /// Creates and adds a new annotation schema value to the current annotation schema.
        /// </summary>
        /// <param name="value">The value of the annotation schema value.</param>
        /// <param name="color">The color to use when displaying annotations of this value.</param>
        /// <param name="description">The description of this annotation schema value.</param>
        /// <returns>The newly added annotation schema value.</returns>
        public AnnotationSchemaValue AddSchemaValue(string value, Color color, string description = null)
        {
            if (!this.IsValidValue(value))
            {
                throw new ArgumentOutOfRangeException("value", $"value ({value}) is not permitted in this schema.");
            }

            var schemaValue = new AnnotationSchemaValue(value, color, description);

            this.InternalValues.Add(schemaValue);
            return(schemaValue);
        }
Example #2
0
 /// <summary>
 /// Removes an annotation schema value from the current annotation schema.
 /// </summary>
 /// <param name="schemaValue">The annotation schema value to remove from the current annotation schema.</param>
 public void RemoveSchemaValue(AnnotationSchemaValue schemaValue)
 {
     this.InternalValues.Remove(schemaValue);
 }