/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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; }
/// <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); }