예제 #1
0
        /// <summary>
        /// Tries to load an annotation schema from disk.
        /// </summary>
        /// <param name="fileName">The full path and filename of the annotation schema to load.</param>
        /// <param name="annotationSchema">The loaded annotation schema if successful.</param>
        /// <returns>True if the annotation schema is loaded successfully, otherwise null.</returns>
        public static bool TryLoadFrom(string fileName, out AnnotationSchema annotationSchema)
        {
            annotationSchema = null;
            if (!File.Exists(fileName))
            {
                return(false);
            }

            try
            {
                annotationSchema = LoadFrom(fileName);
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
 /// <summary>
 /// Unregisters an annotation schema with the registry.
 /// </summary>
 /// <param name="schema">The annotation schema to unregister.</param>
 public void Unregister(AnnotationSchema schema)
 {
     this.InternalSchemas.Remove(schema);
 }
예제 #3
0
 /// <summary>
 /// Registers an annotation schema with the registry.
 /// </summary>
 /// <param name="schema">The annotation schema to register.</param>
 public void Register(AnnotationSchema schema)
 {
     this.InternalSchemas.Add(schema);
 }
예제 #4
0
 /// <summary>
 /// Adds an annotation schema to the annotated event schemas.
 /// </summary>
 /// <param name="schema">The annotation schema to add.</param>
 public void AddSchema(AnnotationSchema schema)
 {
     this.InternalSchemas.Add(schema);
 }
예제 #5
0
 /// <summary>
 /// Sets an annotation on the annotated event.
 /// </summary>
 /// <param name="index">The index of the annotation to set.</param>
 /// <param name="value">Value of the annotation.</param>
 /// <param name="schema">Schema of the annotation.</param>
 public void SetAnnotation(int index, string value, AnnotationSchema schema)
 {
     this.InternalAnnotations[index] = value;
 }
예제 #6
0
 /// <summary>
 /// Adds a new annotation to the annotated event.
 /// </summary>
 /// <param name="value">Value of the annotation.</param>
 /// <param name="schema">Schema of the annotation.</param>
 public void AddAnnotation(string value, AnnotationSchema schema)
 {
     this.InternalAnnotations.Add(value);
 }