private void LoadAssemblyDefAndExport() { List <DocumentedAssembly> assemblies = new List <DocumentedAssembly>(); DocumentedAssembly documentedAssembly = new DocumentedAssembly(TestFile); assemblies.Add(documentedAssembly); ExportConfigFile config = ExportConfigFile.Create(ConfigFile); ExportSettings settings = new ExportSettings(); settings.PublishDirectory = string.Empty; settings.Settings = new DocumentSettings(); settings.Settings.VisibilityFilters = new List <Visibility> { Visibility.Public, Visibility.Internal, Visibility.InternalProtected, Visibility.Protected, Visibility.Private }; Document document = new Document(assemblies); document.Settings = settings.Settings; document.UpdateDocumentMap(); WebsiteExporter exporter = new WebsiteExporter(document, settings, config); exporter.Export(); }
/// <summary> /// Starts the export operation using the selected settings.s /// </summary> private void ExportDocumentation() { this.Cursor = Cursors.AppStarting; //this.exportSelection.Visibility = Visibility.Hidden; this.settings.Visibility = Visibility.Collapsed; this.export.Visibility = Visibility.Collapsed; this.finish.Visibility = Visibility.Visible; System.Windows.Forms.Application.DoEvents(); LiveDocumentorFile.Singleton.OutputLocation = this.publishTo.Text; // store the users output selection // animate the hiding of the options and displaying of the progress bar this.exportSelection.BeginAnimation(OpacityProperty, (AnimationTimeline)this.FindResource("OptionsHide")); this.BeginAnimation(HeightProperty, (AnimationTimeline)this.FindResource("ShrinkWindow")); this.exportProgress.BeginAnimation(OpacityProperty, (AnimationTimeline)this.FindResource("OptionsShow")); System.Windows.Forms.Application.DoEvents(); this.exportSelection.Visibility = System.Windows.Visibility.Hidden; // now make the options invisible to fix issue #191 Documentation.Exporting.Exporter exporter = null; ExportConfigFile config = (ExportConfigFile)this.outputSelection.SelectedItem; this.exportDescription.Text = config.Description; ExportSettings settings = new ExportSettings(); settings.PublishDirectory = this.publishTo.Text.EndsWith("\\") || string.IsNullOrEmpty(this.publishTo.Text) ? this.publishTo.Text : this.publishTo.Text + "\\"; settings.Settings = new Documentation.DocumentSettings(); foreach (PrivacyFilter filter in this.PrivacyFilters) { if (filter.IsSelected) { settings.Settings.VisibilityFilters.Add(filter.Visibility); } } TheBoxSoftware.Documentation.Document document = new Documentation.Document(LiveDocumenter.LiveDocumentorFile.Singleton.LiveDocument.Assemblies); document.Settings = settings.Settings; document.UpdateDocumentMap(); exporter = Documentation.Exporting.Exporter.Create(document, settings, config); exporter.ExportCalculated += new ExportCalculatedEventHandler(exporter_ExportCalculated); exporter.ExportStep += new ExportStepEventHandler(exporter_ExportStep); exporter.ExportException += new ExportExceptionHandler(exporter_ExportException); if (exporter != null) { worker = new System.ComponentModel.BackgroundWorker(); worker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.ThreadedExport); worker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); this.exportStartTime = DateTime.Now; worker.RunWorkerAsync(exporter); } }
/// <summary> /// Loads all of teh ldec files and updates the view with the names of the files. /// </summary> private void LoadConfigFiles() { string appFolder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); foreach (string file in System.IO.Directory.GetFiles(appFolder + @"/ApplicationData/", "*.ldec")) { ExportConfigFile currentConfig = new ExportConfigFile(file); currentConfig.Initialise(); if (currentConfig.IsValid) // only add valid ldec files { exportFiles.Add(currentConfig); } } exportFiles.Sort((f1, f2) => f1.Name.CompareTo(f2.Name)); this.outputSelection.Items.Clear(); this.outputSelection.ItemsSource = exportFiles; }
public void ExportConfigFile_Create() { ExportConfigFile config = new ExportConfigFile("testfile.zip"); }
private void outputSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) { ExportConfigFile o = (ExportConfigFile)this.outputSelection.SelectedItem; this.exportDescription.Text = o.Description; this.exportVersion.Text = "v " + o.Version; switch (o.Exporter) { case Exporters.Website: this.exportType.Text = "Website exporter"; break; case Exporters.Html1: this.exportType.Text = "HTML Help 1 exporter"; break; case Exporters.Html2: this.exportType.Text = "HTML Help 2 exporter"; break; case Exporters.HelpViewer1: this.exportType.Text = "MS Help Viewer 1"; break; case Exporters.XML: this.exportType.Text = "XML"; break; } if (o.HasScreenshot) { System.Windows.Media.Imaging.BitmapImage image = new System.Windows.Media.Imaging.BitmapImage(); image.BeginInit(); image.StreamSource = o.GetScreenshot(); image.EndInit(); this.exportImage.Source = image; } else { this.exportImage.Source = null; } // create an instance of the exporter in the dummy format to allow it to test if it // is able to execute. Documentation.Exporting.Exporter exporter = null; TheBoxSoftware.Documentation.Document document = new Documentation.Document(LiveDocumenter.LiveDocumentorFile.Singleton.LiveDocument.Assemblies); exporter = Documentation.Exporting.Exporter.Create(document, new ExportSettings(), o); List <Issue> issues = exporter.GetIssues(); if (issues.Count > 0) { this.exportLogo.Visibility = Visibility.Hidden; this.warningImage.Visibility = Visibility.Visible; this.exportDescription.Text = string.Empty; foreach (Issue current in issues) { this.exportDescription.Text += current.Description + "\n"; } this.exportType.Text = "Information!"; this.exportVersion.Text = string.Empty; this.export.IsEnabled = false; } else { this.exportLogo.Visibility = Visibility.Visible; this.warningImage.Visibility = Visibility.Hidden; this.export.IsEnabled = true; } }
/// <summary> /// Initialises a new instance of the IncludeFileXmlRenderer. /// </summary> /// <param name="configFile">A reference to the export config file for this export.</param> /// <param name="baseDirectory">The base output directory where all the files exported to.</param> public IncludeFileXmlRenderer(ExportConfigFile configFile) { this.configFile = configFile; this.baseDirectory = baseDirectory; }