예제 #1
0
        /// <summary>
        /// Locates the XML doc comment file corresponding to the given
        /// <see cref="System.Reflection.Assembly"/>, in the given directories.
        /// </summary>
        ///
        /// <param name="assembly">
        /// The assembly whose doc comments are retrieved.
        /// </param>
        ///
        /// <param name="directories">
        /// The directory names to search.
        /// </param>
        ///
        /// <param name="fileProxy">
        /// The proxy to the file system.
        /// </param>
        ///
        /// <returns>
        /// The full path to the requested XML doc comment file, if it exists.
        /// </returns>
        ///
        /// <exception cref="System.IO.FileNotFoundException">
        /// The XML doc comments file was not found, for the given set of parameters.
        /// </exception>
        private static string ResolveDocCommentsLocation(Assembly assembly, XmlDocCommentDirectoryElementCollection directories, IFile fileProxy)
        {
            string assemblyFileName       = assembly.GetName().Name;
            string xmlDocCommentsFilename = String.Concat(assemblyFileName, XmlFileExtension);

            foreach (XmlDocCommentDirectoryElement directory in directories)
            {
                string xmlDocCommentsFullPath = Path.GetFullPath(Path.Combine(directory.Name, xmlDocCommentsFilename));
                if (fileProxy.Exists(xmlDocCommentsFullPath))
                {
                    return(xmlDocCommentsFullPath);
                }
            }

            throw new FileNotFoundException(
                      String.Format(Resources.Error_XmlDocComments_AssemblyNotResolved, assemblyFileName),
                      assemblyFileName);
        }
예제 #2
0
        /// <summary>
        /// Locates the XML doc comment file corresponding to the given
        /// <see cref="System.Reflection.Assembly"/>, in the given directories.
        /// </summary>
        ///
        /// <param name="assembly">
        /// The assembly whose doc comments are retrieved.
        /// </param>
        ///
        /// <param name="directories">
        /// The directory names to search.
        /// </param>
        ///
        /// <returns>
        /// The full path to the requested XML doc comment file, if it exists.
        /// </returns>
        ///
        /// <exception cref="System.IO.FileNotFoundException">
        /// The XML doc comments file was not found, for the given set of parameters.
        /// </exception>
        private static string ResolveDocCommentsLocation(Assembly assembly, XmlDocCommentDirectoryElementCollection directories)
        {
            string assemblyFileName       = assembly.GetName().Name;
            string xmlDocCommentsFilename = String.Concat(assemblyFileName, XmlFileExtension);

            foreach (XmlDocCommentDirectoryElement directory in directories)
            {
                string xmlDocCommentsFullPath = Path.GetFullPath(Path.Combine(directory.Name, xmlDocCommentsFilename));
                if (File.Exists(xmlDocCommentsFullPath))
                {
                    return(xmlDocCommentsFullPath);
                }
            }

            throw new FileNotFoundException(
                      String.Format("Could not locate an XML doc comments file in the configured search list, for the assembly named '{0}'.", assemblyFileName),
                      assemblyFileName);
        }
예제 #3
0
 /// <summary>
 /// Creates a new instance of the <see cref="XmlDocCommentReaderSettings"/> class
 /// with the given directory names.
 /// </summary>
 ///
 /// <param name="docCommentDirectoryNames">
 /// The search paths used to locate an XML doc comments file.
 /// </param>
 public XmlDocCommentReaderSettings(IEnumerable <string> docCommentDirectoryNames)
 {
     this["XmlDocCommentDirectories"] = new XmlDocCommentDirectoryElementCollection(docCommentDirectoryNames);
 }
 /// <summary>
 /// Creates a new instance of the <see cref="XmlDocCommentReaderSettings"/> class
 /// with the given directory names.
 /// </summary>
 /// 
 /// <param name="docCommentDirectoryNames">
 /// The search paths used to locate an XML doc comments file.
 /// </param>
 public XmlDocCommentReaderSettings(IEnumerable<string> docCommentDirectoryNames)
 {
     this["XmlDocCommentDirectories"] = new XmlDocCommentDirectoryElementCollection(docCommentDirectoryNames);
 }
        /// <summary>
        /// Locates the XML doc comment file corresponding to the given
        /// <see cref="System.Reflection.Assembly"/>, in the given directories.
        /// </summary>
        /// 
        /// <param name="assembly">
        /// The assembly whose doc comments are retrieved.
        /// </param>
        /// 
        /// <param name="directories">
        /// The directory names to search.
        /// </param>
        /// 
        /// <param name="fileProxy">
        /// The proxy to the file system.
        /// </param>
        /// 
        /// <returns>
        /// The full path to the requested XML doc comment file, if it exists.
        /// </returns>
        /// 
        /// <exception cref="System.IO.FileNotFoundException">
        /// The XML doc comments file was not found, for the given set of parameters.
        /// </exception>
        private static string ResolveDocCommentsLocation(Assembly assembly, XmlDocCommentDirectoryElementCollection directories, IFile fileProxy)
        {
            string assemblyFileName = assembly.GetName().Name;
            string xmlDocCommentsFilename = String.Concat(assemblyFileName, XmlFileExtension);

            foreach (XmlDocCommentDirectoryElement directory in directories)
            {
                string xmlDocCommentsFullPath = Path.GetFullPath(Path.Combine(directory.Name, xmlDocCommentsFilename));
                if (fileProxy.Exists(xmlDocCommentsFullPath))
                {
                    return xmlDocCommentsFullPath;
                }
            }

            throw new FileNotFoundException(
                String.Format(Resources.Error_XmlDocComments_AssemblyNotResolved, assemblyFileName),
                assemblyFileName);
        }