Beispiel #1
0
        //-------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------
        private void ValidateFootnoteLocation(string FootnoteLocationReference)
        {
            HyperlinkReference Reference = new HyperlinkReference(FootnoteLocationReference);

            if (Reference.UrlSpecified == true)
            {
                StringBuilder MessageBuilder = new StringBuilder();
                string        StringFormat   = AssemblyResources.GetName("FootnoteReferencesFactInExternalDoc");
                MessageBuilder.AppendFormat(StringFormat, Reference.ElementId, Reference.Url);
                validatingFragment.AddValidationError(new HyperlinkReferenceValidationError(Reference, MessageBuilder.ToString()));
                return;
            }
            if (validatingFragment.GetFact(Reference.ElementId) == null)
            {
                StringBuilder MessageBuilder = new StringBuilder();
                string        StringFormat   = AssemblyResources.GetName("NoFactForFootnoteReference");
                MessageBuilder.AppendFormat(StringFormat, FootnoteLocationReference);
                validatingFragment.AddValidationError(new HyperlinkReferenceValidationError(Reference, MessageBuilder.ToString()));
                return;
            }
        }
 //-------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------
 private void ValidateFootnoteLocation(string FootnoteLocationReference)
 {
     HyperlinkReference Reference = new HyperlinkReference(FootnoteLocationReference);
     if (Reference.UrlSpecified == true)
     {
         StringBuilder MessageBuilder = new StringBuilder();
         string StringFormat = AssemblyResources.GetName("FootnoteReferencesFactInExternalDoc");
         MessageBuilder.AppendFormat(StringFormat, Reference.ElementId, Reference.Url);
         AddValidationError(new HyperlinkReferenceValidationError(Reference, MessageBuilder.ToString()));
         return;
     }
     if (GetFact(Reference.ElementId) == null)
     {
         StringBuilder MessageBuilder = new StringBuilder();
         string StringFormat = AssemblyResources.GetName("NoFactForFootnoteReference");
         MessageBuilder.AppendFormat(StringFormat, FootnoteLocationReference);
         AddValidationError(new HyperlinkReferenceValidationError(Reference, MessageBuilder.ToString()));
         return;
     }
 }
 //-------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------
 private bool UrlReferencesFragmentDocument(HyperlinkReference Href)
 {
     if (Href.UrlSpecified == false)
         return false;
     string DocFullPath = Path.GetFullPath(this.Document.Filename);
     string HrefFullPathString;
     if (Href.Url.IndexOf(Path.DirectorySeparatorChar) == -1)
         HrefFullPathString = this.Document.Path + Path.DirectorySeparatorChar + Href.Url;
     else
         HrefFullPathString = Href.Url;
     string HrefFullPath = Path.GetFullPath(HrefFullPathString);
     if (DocFullPath.Equals(HrefFullPath) == true)
         return true;
     return false;
 }