/// <summary> /// Class constructor. This constructor will store a message and will automatically set the /// Exception property to a null value. /// </summary> /// <param name="arc"> /// The footnote arc containing the error being reported. /// </param> /// <param name="message"> /// The message to be stored in the validation error. /// </param> internal FootnoteArcValidationError(FootnoteArc arc, string message) : base(message) { this.Arc = arc; }
/// <summary> /// Class constructor. This constructor will store a message and an exception. /// </summary> /// <param name="arc"> /// The footnote arc containing the error being reported. /// </param> /// <param name="message"> /// The message to be stored in the validation error. /// </param> /// <param name="exception"> /// The exception to be stored in the validation error. /// </param> internal FootnoteArcValidationError(FootnoteArc arc, string message, Exception exception) : base(message, exception) { this.Arc = arc; }
//=============================================================================== //------------------------------------------------------------------------------- //------------------------------------------------------------------------------- private void ValidateFootnoteArc(FootnoteArc CurrentArc) { FootnoteLocator Locator = CurrentArc.Link.GetLocator(CurrentArc.FromId); if (Locator == null) { StringBuilder MessageBuilder = new StringBuilder(); string StringFormat = AssemblyResources.GetName("CannotFindFootnoteLocator"); MessageBuilder.AppendFormat(StringFormat, CurrentArc.Title, CurrentArc.FromId); AddValidationError(new FootnoteArcValidationError(CurrentArc, MessageBuilder.ToString())); return; } if ((Locator.Href.UrlSpecified == true) && (UrlReferencesFragmentDocument(Locator.Href) == false)) { StringBuilder MessageBuilder = new StringBuilder(); string StringFormat = AssemblyResources.GetName("FootnoteReferencesFactInExternalDoc"); MessageBuilder.AppendFormat(StringFormat, Locator.Href.ElementId, Locator.Href.Url); AddValidationError(new FootnoteArcValidationError(CurrentArc, MessageBuilder.ToString())); return; } CurrentArc.From = GetFact(Locator.Href.ElementId); if (CurrentArc.From == null) { StringBuilder MessageBuilder = new StringBuilder(); string StringFormat = AssemblyResources.GetName("CannotFindFactForFootnoteArc"); MessageBuilder.AppendFormat(StringFormat, CurrentArc.Title, Locator.Href); AddValidationError(new FootnoteArcValidationError(CurrentArc, MessageBuilder.ToString())); return; } CurrentArc.To = CurrentArc.Link.GetFootnote(CurrentArc.ToId); if (CurrentArc.To == null) { StringBuilder MessageBuilder = new StringBuilder(); string StringFormat = AssemblyResources.GetName("CannotFindFootnoteForFootnoteArc"); MessageBuilder.AppendFormat(StringFormat, CurrentArc.Title, CurrentArc.ToId); AddValidationError(new FootnoteArcValidationError(CurrentArc, MessageBuilder.ToString())); return; } }