Logo Search packages:      
Sourcecode: ndoc version File versions  Download package

NDoc::Documenter::NativeHtmlHelp2::Engine::HtmlFactory::HtmlFactory ( string  tempFileName,
string  outputDirectory,
ExternalHtmlProvider  htmlProvider,
NativeHtmlHelp2Config  config 
) [inline]

Constructs a new instance of HtmlFactory.

Parameters:
tempFileName NDoc generated temp xml file
outputDirectory The directory to write the Html files to
htmlProvider Object the provides additional Html content
config 

Definition at line 76 of file HtmlFactory.cs.

References NDoc::Core::Reflection::BaseReflectionDocumenterConfig::DocumentAttributes, NDoc::Core::Reflection::BaseReflectionDocumenterConfig::SdkDocLanguage, NDoc::Core::Reflection::BaseReflectionDocumenterConfig::SdkDocVersion, NDoc::Documenter::NativeHtmlHelp2::NativeHtmlHelp2Config::Title, and NDoc::Documenter::NativeHtmlHelp2::NativeHtmlHelp2Config::Version.

            {
                  Debug.WriteLine("mem before doc load " + GC.GetTotalMemory(true).ToString());
                  // Load the XML documentation.
                  xmlDocumentation = new XmlDocument();
                  Stream tempFile=null;
                  try
                  {
                        tempFile=File.Open(tempFileName,FileMode.Open,FileAccess.Read);

                        FilteringXmlTextReader fxtr = new FilteringXmlTextReader(tempFile);
                        xmlDocumentation.Load(fxtr);

                        tempFile.Seek(0,SeekOrigin.Begin);

                        XmlTextReader reader = new XmlTextReader(tempFile);
                        xPathDocumentation = new XPathDocument(reader,XmlSpace.Preserve);

                  }
                  finally
                  {
                        if (tempFile!=null) tempFile.Close();
                        if (File.Exists(tempFileName)) File.Delete(tempFileName);
                  }

                  //check if there is anything to document
                  XmlNodeList typeNodes = xmlDocumentation.SelectNodes("/ndoc/assembly/module/namespace/*[name()!='documentation']");
                  if ( typeNodes.Count == 0 )               
                        throw new DocumenterException("There are no documentable types in this project.\n\nAny types that exist in the assemblies you are documenting have been excluded by the current visibility settings.\nFor example, you are attempting to document an internal class, but the 'DocumentInternals' visibility setting is set to False.\n\nNote: C# defaults to 'internal' if no accessibilty is specified, which is often the case for Console apps created in VS.NET...");

                  if ( !Directory.Exists( outputDirectory ) )
                        throw new Exception( string.Format( "The output directory {0}, does not exist", outputDirectory ) );

                  _outputDirectory = outputDirectory;
                  documentedNamespaces = new ArrayList();
            


                  string NSName="";
                  string FrameworkVersion="";
                  if ( config.SdkDocVersion == SdkVersion.SDK_v1_0 )
                  {
                        NSName = "ms-help://MS.NETFrameworkSDK";
                        FrameworkVersion="1.0";
                  }
                  else if ( config.SdkDocVersion == SdkVersion.SDK_v1_1 )
                  {
                        NSName = "ms-help://MS.NETFrameworkSDKv1.1";
                        FrameworkVersion="1.1";
                  }
                  else
                        Debug.Assert( false );        // remind ourselves to update this list when new framework versions are supported

                  string DocLangCode = Enum.GetName(typeof(SdkLanguage),config.SdkDocLanguage).Replace("_","-");
                  if (DocLangCode != "en")
                        NSName = NSName + "." + DocLangCode;

                  nsMapper = new NamespaceMapper( Path.Combine( Directory.GetParent( _outputDirectory ).ToString(), "NamespaceMap.xml" ) );
                  nsMapper.SetSystemNamespace(NSName);

                  fileNameMapper = new FileNameMapper(xmlDocumentation);
                  _htmlProvider = htmlProvider;
                  _utilities = new MsdnXsltUtilities( this.nsMapper, this.fileNameMapper );

                  this.Arguments = new XsltArgumentList();
                  this.Arguments.AddExtensionObject( "urn:ndoc-sourceforge-net:documenters.NativeHtmlHelp2.xsltUtilities", _utilities );
                  this.Arguments.AddExtensionObject( "urn:NDocExternalHtml", _htmlProvider );

                  // add properties passed to the stylesheets
                  this.Arguments.AddParam( "ndoc-title", "", config.Title );
                  this.Arguments.AddParam( "ndoc-document-attributes", "", config.DocumentAttributes );
                  this.Arguments.AddParam( "ndoc-net-framework-version", "", FrameworkVersion );
                  this.Arguments.AddParam( "ndoc-version", "", config.Version );

                  XPathDocument DocumenterSpecificXml = GetDocumenterSpecificXmlData(config);
                  XPathNodeIterator it = DocumenterSpecificXml.CreateNavigator().Select("*");
                  this.Arguments.AddParam( "documenter-specific-xml", "", it );
                  
            }


Generated by  Doxygen 1.6.0   Back to index