Exemplo n.º 1
0
        private void AddTargets(string file, ReferenceLinkType type)
        {
            XPathDocument document = new XPathDocument(file);

            // This will only load into the memory...
            TargetCollectionXmlUtilities.AddTargets(_storage, document.CreateNavigator(), type);
        }
Exemplo n.º 2
0
 private void AddDatabaseTargets(string file, ReferenceLinkType type)
 {
     try
     {
         XPathDocument document = new XPathDocument(file);
         // This will only load into the memory...
         TargetCollectionXmlUtilities.AddTargets(_msdnStorage, document.CreateNavigator(), type);
     }
     catch (XmlSchemaException e)
     {
         WriteMessage(MessageLevel.Error, String.Format(
                          "The reference targets file '{0}' is not valid. The error message is: {1}",
                          file, BuildComponentUtilities.GetExceptionMessage(e)));
     }
     catch (XmlException e)
     {
         WriteMessage(MessageLevel.Error, String.Format(
                          "The reference targets file '{0}' is not well-formed XML. The error message is: {1}",
                          file, BuildComponentUtilities.GetExceptionMessage(e)));
     }
     catch (IOException e)
     {
         WriteMessage(MessageLevel.Error, String.Format(
                          "An access error occurred while opening the reference targets file '{0}'. The error message is: {1}",
                          file, BuildComponentUtilities.GetExceptionMessage(e)));
     }
 }