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

override void NDoc::Documenter::NativeHtmlHelp2::NativeHtmlHelp2Documenter::Build ( Project  project  )  [inline, virtual]

See IDocumenter.

Implements NDoc::Core::BaseDocumenter.

Definition at line 164 of file NativeHtmlHelp2Documenter.cs.

References NDoc::Documenter::NativeHtmlHelp2::HxProject::IncludeFile::AddDirectory(), NDoc::Core::Workspace::Clean(), NDoc::Core::Workspace::CleanIntermediates(), NDoc::Core::Workspace::ContentDirectory, NDoc::Core::Workspace::ContentDirectoryAdded, NDoc::Documenter::NativeHtmlHelp2::HxProject::TOCFile::FileName, NDoc::Documenter::NativeHtmlHelp2::HxProject::HxFile::LangId, NDoc::Core::Workspace::Prepare(), NDoc::Core::Workspace::RemoveResourceDirectory(), NDoc::Core::Workspace::ResourceDirectory, NDoc::Documenter::NativeHtmlHelp2::HxProject::HxFile::Save(), NDoc::Core::Workspace::SaveOutputs(), NDoc::Documenter::NativeHtmlHelp2::HxProject::ProjectFile::TOCFile, and NDoc::Core::Workspace::WorkingDirectory.

            {
                  if ( !HxObject.HxCompIsInstalled )
                        throw new DocumenterException( "Could not find Html Help 2 compiler. Please make sure VSHIK 2003 is properly installed" );

                  try
                  {
#if DEBUG
                        int start = Environment.TickCount;
#endif
                        OnDocBuildingStep( 0, "Initializing..." );

                        Workspace workspace = new NativeHtmlHelp2Workspace( WorkingPath );
                        workspace.Clean();
                        workspace.Prepare();

                        UnPackResources( workspace );

                        // set up the includes file
                        IncludeFile includes = IncludeFile.CreateFrom( Path.Combine( workspace.ResourceDirectory, "includes.hxf" ), "includes" );
                        // attach to this event so resource directories get included in the include file
                        workspace.ContentDirectoryAdded += new ContentEventHandler( includes.AddDirectory ); 

                        // create and save the named url index
                        CreateNamedUrlIndex( workspace );

                        // save the includes file
                        includes.Save( workspace.WorkingDirectory );

                        // set up the table of contents
                        TOCFile toc = TOCFile.CreateFrom( Path.Combine( workspace.ResourceDirectory, "project.HxT" ), MyConfig.HtmlHelpName );
                        toc.LangId = MyConfig.LangID;

                        // set up the project file
                        ProjectFile HxProject = CreateProjectFile( workspace );
                        HxProject.TOCFile = toc.FileName;
                        HxProject.Save( workspace.WorkingDirectory );

                        // get the ndoc xml
                        OnDocBuildingStep( 10, "Merging XML documentation..." );

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

                        HtmlFactory factory = null;

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

                              GC.Collect();
                              GC.WaitForPendingFinalizers();
                              GC.Collect();

                              // create and intialize a HtmlFactory
                              ExternalHtmlProvider htmlProvider = new ExternalHtmlProvider(
                                    MyConfig.HeaderHtml, MyConfig.FooterHtml);
                              factory = new HtmlFactory(tempFileName, 
                                    workspace.ContentDirectory, htmlProvider, MyConfig);
                        } 
                        finally 
                        {
                              if (tempFileName != null && File.Exists(tempFileName)) 
                              {
                                    File.Delete(tempFileName);
                              }
                        }

                        // generate all the html content - builds the toc along the way
                        using( new TOCBuilder( toc, factory ) )
                              MakeHtml( workspace, factory );

                        toc.Save( workspace.WorkingDirectory );

                        //then compile the HxC into an HxS
                        OnDocBuildingStep( 65, "Compiling Html Help 2 Files..." );
                        CompileHxCFile( workspace );

                        // copy outputs to the final build location
                        workspace.SaveOutputs( "*.Hxs" );
                        workspace.SaveOutputs( "*.HxI" );

                        // do clean up and final registration steps
                        OnDocBuildingStep( 95, "Finishing up..." );

                        if ( MyConfig.RegisterTitleWithNamespace )
                              RegisterTitleWithCollection( workspace );
                        else if ( MyConfig.RegisterTitleAsCollection )
                              RegisterTitleAsCollection( workspace );

                        // create collection level files
                        if( MyConfig.GenerateCollectionFiles )
                              CreateCollectionFiles( workspace );

                        workspace.RemoveResourceDirectory();
                        if ( MyConfig.CleanIntermediates )
                              workspace.CleanIntermediates();

#if DEBUG
                        Trace.WriteLine( string.Format( "It took a total of {0} seconds", ( Environment.TickCount - start ) / 1000 ) );
#endif
                        Trace.WriteLine( "Build complete" );
                  }
                  catch ( Exception e )
                  {
                        throw new DocumenterException( "An error occured while creating the documentation", e );
                  }
            }


Generated by  Doxygen 1.6.0   Back to index