Exemplo n.º 1
0
		/// <summary>
		/// Load the predefined set of xslt stylesheets into a dictionary
		/// </summary>
		/// <param name="extensibiltyStylesheet"></param>
		/// <returns>The populated collection</returns>
		public static StyleSheetCollection LoadStyleSheets(string extensibiltyStylesheet)
		{
			StyleSheetCollection stylesheets = new StyleSheetCollection();

#if NO_RESOURCES
			string resourceBase = "file://" + Path.GetFullPath(Path.Combine(System.Windows.Forms.Application.StartupPath, @"..\..\..\Documenter\Intellisense\xslt"));
#else
			string resourceBase = "NDoc.Documenter.Intellisense.xslt";
#endif

			XsltResourceResolver resolver = new XsltResourceResolver(resourceBase);
			resolver.ExtensibiltyStylesheet = extensibiltyStylesheet;
			Trace.Indent();

			stylesheets.AddFrom("assembly", resolver);

			Trace.Unindent();

			return stylesheets;
		}
Exemplo n.º 2
0
		/// <summary>
		/// Builds the specified project.
		/// </summary>
		/// <param name="project">Project.</param>
		public override void Build(Project project)
		{
			OnDocBuildingStep(0, "Initializing...");

			try
			{
				OnDocBuildingStep(10, "Merging XML documentation...");

				// Will hold the name of the file name containing the XML doc
				string tempFileName = null;

				try 
				{
					// determine temp file name
					tempFileName = Path.GetTempFileName();
					// Let the Documenter base class do it's thing.
					MakeXmlFile(project, tempFileName);

					// Load the XML documentation into XPATH doc.
					using (FileStream tempFile = File.Open(tempFileName, FileMode.Open, FileAccess.Read)) 
					{
						xpathDocument = new XPathDocument(tempFile);
					}
				}
				finally
				{
					if (tempFileName != null && File.Exists(tempFileName)) 
					{
						File.Delete(tempFileName);
					}
				}

				OnDocBuildingStep(30, "Loading XSLT files...");

				stylesheets = StyleSheetCollection.LoadStyleSheets(String.Empty);

				OnDocBuildingStep(40, "Generating XML files...");
				MakeXmlForAssemblies();
			}
			catch (Exception ex)
			{
				throw new DocumenterException(ex.Message, ex);
			}
			finally
			{
				xpathDocument = null;
				stylesheets = null;
			}
		}