/// <summary> /// Does this annotation already exist in the database /// </summary> /// <param name="annotation">The annotation to check for</param> /// <returns>The annotation if it exists, null otherwise</returns> public static Annotation Existing(Annotation annotation) { return data.FirstOrDefault(a => a.target.selector.xpath == annotation.target.selector.xpath && MatchString(a.target.selector.exact, annotation.target.selector.exact) && a.body.value == annotation.body.value); }
/// <summary> /// Annotate the spec using a single annotation passed in. /// </summary> /// <param name="a">The annotation to apply to the spec</param> private void Annotate(Annotation a) { FileWebView.InvokeScriptAsync("Annotate", new List<string> { a.body.value, a.target.selector.exact, a.id }); }
/// <summary> /// Does this annotation already exist in the database /// </summary> /// <param name="annotation">The annotation to check for</param> /// <returns>true if an annotation exists, false otherwise</returns> public static bool Exists(Annotation annotation) { return Existing(annotation) != null; }