/// <summary> /// Creates a new instance of the <see cref="XmlDocCommentReader"/> class /// by searching for a doc comments file that corresponds to the given assembly. /// Searches the given paths, and configures the reader to use a user-defined read policy. /// </summary> /// /// <param name="assembly"> /// The <see cref="System.Reflection.Assembly"/> whose doc comments are retrieved. /// </param> /// /// <param name="settings"> /// The <see cref="XmlDocCommentReaderSettings"/> object containing the doc comment search paths. /// </param> /// /// <param name="fileProxy"> /// The proxy to the file system. /// </param> /// /// <param name="createReadPolicy"> /// A factory method that accepts the full path to an XML doc comments file, /// returning a user-defined read policy. /// </param> /// /// <remarks> /// Used internally by test code to override file IO operations. /// </remarks> internal XmlDocCommentReader(Assembly assembly, XmlDocCommentReaderSettings settings, IFile fileProxy, CreateReadPolicyDelegate createReadPolicy) { m_settings = settings ?? XmlDocCommentReaderSettings.Default; m_docCommentsFullPath = ResolveDocCommentsLocation(assembly, m_settings.DirectoryNames, fileProxy); m_fileProxy = fileProxy; m_docCommentsReadPolicy = createReadPolicy(m_docCommentsFullPath); }
/// <summary> /// Creates a new instance of the <see cref="XmlDocCommentReader"/> class /// by searching for a doc comments file that corresponds to the given assembly. /// Searches the given paths, and configures the reader to use a user-defined read policy. /// </summary> /// /// <param name="assembly"> /// The <see cref="System.Reflection.Assembly"/> whose doc comments are retrieved. /// </param> /// /// <param name="settings"> /// The <see cref="XmlDocCommentReaderSettings"/> object containing the doc comment search paths. /// </param> /// /// <param name="createReadPolicy"> /// A factory method that accepts the full path to an XML doc comments file, /// returning a user-defined read policy. /// </param> public XmlDocCommentReader(Assembly assembly, XmlDocCommentReaderSettings settings, CreateReadPolicyDelegate createReadPolicy) : this(assembly, settings, DefaultFileProxy, createReadPolicy) { }
internal XmlDocCommentReader(AssemblyDefinition assemblyDefinition, XmlDocCommentReaderSettings settings, CreateReadPolicyDelegate createReadPolicy) { _settings = settings ?? XmlDocCommentReaderSettings.Default; _docCommentsFullPath = ResolveDocCommentsLocation(assemblyDefinition, _settings.DirectoryNames); _docCommentsReadPolicy = createReadPolicy(_docCommentsFullPath); }
/// <summary> /// Creates a new instance of the <see cref="XmlDocCommentReader"/> class /// with a given path to the XML doc comments, and configures the reader /// to use a user-defined read policy. /// </summary> /// /// <param name="docCommentsFullPath"> /// The full path of the XML doc comments. /// </param> /// /// <param name="fileProxy"> /// The proxy to the file system. /// </param> /// /// <param name="readPolicy"> /// The doc comment read policy. /// </param> /// /// <remarks> /// Used internally by test code to override file IO operations. /// </remarks> /// /// <exception cref="System.IO.FileNotFoundException"> /// <paramref name="docCommentsFullPath"/> could does not exist or is inaccessible. /// </exception> internal XmlDocCommentReader(string docCommentsFullPath, IFile fileProxy, IXmlDocCommentReadPolicy readPolicy) { if (!fileProxy.Exists(docCommentsFullPath)) { throw new FileNotFoundException( String.Format(Resources.Error_XmlDocComments_FileNotFound, docCommentsFullPath), docCommentsFullPath); } m_fileProxy = fileProxy; m_docCommentsFullPath = docCommentsFullPath; m_docCommentsReadPolicy = readPolicy; m_settings = XmlDocCommentReaderSettings.Default; }