public static void Create(BuildDocumenter documenter, TestOptions options) { if (!options.BuildReferences) { return; } BuildSettings settings = documenter.Settings; ReferenceEngineSettings engineSettings = settings.EngineSettings[ BuildEngineType.Reference] as ReferenceEngineSettings; Debug.Assert(engineSettings != null); if (engineSettings == null) { return; } sampleDir = options.SampleDir; workingDir = options.WorkingDir; sandAssistDir = options.SandAssistDir; tocType = options.TocType; // Decide which namespace layout: Flat or Hierarchical ReferencesTocType refTestType = ReferencesTocType.Hierarchical; // Decide whether to use namespace root container engineSettings.RootNamespaceContainer = true; if (refTestType == ReferencesTocType.Hierarchical) { ReferenceTocLayoutConfiguration tocLayout = engineSettings.TocLayout; tocLayout.ContentsAfter = false; tocLayout.LayoutType = ReferenceTocLayoutType.Hierarchical; } // For testing script sharp... TestSharpScript(documenter, options, engineSettings); // For testing portable class libraries... TestPortable(documenter, options, engineSettings); // For testing Silverlight 5 projects... TestSilverlight(documenter, options, engineSettings); // For testing ASP.NET MVC projects... TestOther(documenter, options, engineSettings); // For testing VS.NET projects... TestSolution(documenter, options, engineSettings); }
public TestOptions(BuildSettings settings) { BuildExceptions.NotNull(settings, "settings"); _settings = settings; string allSamplesDir = @"..\Samples\Helpers\"; _sampleDir = Path.GetFullPath(allSamplesDir); _workingDir = Path.Combine(_sampleDir, "HelpTest"); _sandAssistDir = Environment.CurrentDirectory; _tocType = CustomTocType.TopicRoot; }
public static void Create(BuildDocumenter documenter, TestOptions options) { if (!options.BuildConceptual) { return; } sampleDir = options.SampleDir; workingDir = options.WorkingDir; sandAssistDir = options.SandAssistDir; tocType = options.TocType; // 1. Add the main topics... TestMain(documenter, options); // 2. Add the contents from HelpRegister topics... TestOthers(documenter, options); // 3. Add the WiX XML Schema topics... TestXsdDocsWiX(documenter, options); }
public static void Create(BuildDocumenter documenter, TestOptions options) { if (!options.BuildReferences) { return; } BuildSettings settings = documenter.Settings; ReferenceEngineSettings engineSettings = settings.EngineSettings[ BuildEngineType.Reference] as ReferenceEngineSettings; Debug.Assert(engineSettings != null); if (engineSettings == null) { return; } sampleDir = options.SampleDir; workingDir = options.WorkingDir; sandAssistDir = options.SandAssistDir; tocType = options.TocType; // Decide which namespace layout: Flat or Hierarchical ReferencesTocType refTestType = ReferencesTocType.Hierarchical; // Decide whether to use namespace root container engineSettings.RootNamespaceContainer = true; if (refTestType == ReferencesTocType.Hierarchical) { ReferenceTocLayoutConfiguration tocLayout = engineSettings.TocLayout; tocLayout.ContentsAfter = false; tocLayout.LayoutType = ReferenceTocLayoutType.Hierarchical; } // Test most reference topic options, including... // 1. Code snippets // 2. Version information: Advanced // 3. Media/Image contents // 4. Reference filters TestMain(documenter, options, engineSettings); // Test mainly hierarchical table of contents, including... // 1. tocexclude/excludetoc tag support // 2. Extension methods // 3. Version information: Assembly-And-File // 4. Linking to conceptual help contents // 5. Events TestHierarchicalToc(documenter, options, engineSettings); // Test assembly redirection and auto-dependency resolution, including... // 1. .NET 4 features (including Action<...> and Func<...>) // 2. Embedding contents. You can include linked third-party library // documentation, which will not show in TOC but accessible from links // 3. WPF features like Xmlns-For-Xaml and Xaml usage. // 4. Version information: Assembly //TestRedirection(documenter, options, engineSettings); // Test for WPF 4.0 and Silverlight 4.0 assemblies, including... // 1. WPF features like Xmlns-For-Xaml and Xaml usage. // 2. Version information: None //TestSilverlightWPF(documenter, options, engineSettings); // Test other features... // 1. Testing C++/CLR library // 2. Version information: Assembly-And-File // Has no file version. Assembly version is auto-incremental. // 3. Support for Visual C++ Project content source. //TestOthers(documenter, options, engineSettings); }
public static void Create(BuildDocumenter documenter, TestOptions options) { CustomTocType tocType = options.TocType; if (tocType == CustomTocType.None) { return; } BuildSettings settings = documenter.Settings; ReferenceEngineSettings engineSettings = settings.EngineSettings[ BuildEngineType.Reference] as ReferenceEngineSettings; IList <BuildGroup> listGroups = documenter.Groups; // Create a custom TOC layout for the CHM format only... if (tocType != CustomTocType.Default) { FormatChm chmFormat = settings.Formats[BuildFormatType.HtmlHelp1] as FormatChm; if (chmFormat != null && chmFormat.Enabled) { TocContent chmTocContent = new TocContent(); for (int i = 0; i < listGroups.Count; i++) { TocItem tocItem = new TocItem(); tocItem.SourceType = TocItemSourceType.Group; tocItem.SourceRecursive = true; tocItem.SourceId = listGroups[i].Id; chmTocContent.Add(tocItem); } chmFormat.TocContent = chmTocContent; } } BuildToc buildToc = settings.Toc; TocContent tocContent = buildToc.Content; switch (tocType) { case CustomTocType.None: break; case CustomTocType.Default: for (int i = 0; i < listGroups.Count; i++) { TocItem tocItem = new TocItem(); tocItem.SourceType = TocItemSourceType.Group; tocItem.SourceRecursive = true; tocItem.SourceId = listGroups[i].Id; tocContent.Add(tocItem); } break; case CustomTocType.ReferenceRoot: // Assumes there are three groups and the third is reference group, // and root namespaces container is enabled... if (listGroups.Count == 3 && (engineSettings != null && engineSettings.RootNamespaceContainer)) { TocItem rootItem = new TocItem(); rootItem.SourceType = TocItemSourceType.NamespaceRoot; rootItem.SourceRecursive = false; rootItem.SourceId = listGroups[2].Id; tocContent.Add(rootItem); for (int i = 0; i < listGroups.Count - 1; i++) { TocItem tocItem = new TocItem(); tocItem.SourceType = TocItemSourceType.Group; tocItem.SourceRecursive = true; tocItem.SourceId = listGroups[i].Id; rootItem.Add(tocItem); } TocItem namespaceItem1 = new TocItem(); namespaceItem1.SourceType = TocItemSourceType.Namespace; namespaceItem1.SourceRecursive = true; namespaceItem1.SourceId = "N:ANamespace"; rootItem.Add(namespaceItem1); TocItem namespaceItem2 = new TocItem(); namespaceItem2.SourceType = TocItemSourceType.Namespace; namespaceItem2.SourceRecursive = true; namespaceItem2.SourceId = "N:TestLibrary"; rootItem.Add(namespaceItem2); } break; case CustomTocType.TopicRoot: if (settings.BuildConceptual && settings.BuildReferences) { TocItem rootTocItem = new TocItem(); rootTocItem.SourceType = TocItemSourceType.Topic; rootTocItem.SourceRecursive = true; rootTocItem.SourceId = "d36e744f-c053-4e94-9ac9-b1ee054d8de2"; tocContent.Add(rootTocItem); for (int i = 0; i < listGroups.Count; i++) { TocItem tocItem = new TocItem(); tocItem.SourceType = TocItemSourceType.Group; tocItem.SourceRecursive = true; tocItem.SourceId = listGroups[i].Id; rootTocItem.Add(tocItem); } } break; } }