/// <summary> /// Generate a <see cref="Command"/> documentation using the Khronos reference pages. /// </summary> /// <param name="sw"> /// A <see cref="SourceStreamWriter"/> used to write the documentation of <paramref name="command"/>. /// </param> /// <param name="ctx"> /// A <see cref="RegistryContext"/> that defines the OpenGL specification. /// </param> /// <param name="command"> /// The <see cref="Command"/> to be documented. /// </param> /// <param name="fail"></param> public static void GenerateDocumentation(this ICollection <IRegistryDocumentation> docs, SourceStreamWriter sw, RegistryContext ctx, Command command, bool fail, List <CommandParameter> commandParams) { if (docs == null || docs.Count == 0) { return; } List <IRegistryDocumentation> validDocs = GetDocRegistries(docs, command); if (validDocs.Count > 0) { validDocs[0].GenerateDocumentation(sw, ctx, command, fail, commandParams); } else { RegistryDocumentation.GenerateDocumentation(sw, ctx, command, fail, commandParams, new List <RegistryDocumentationHandler>(new RegistryDocumentationHandler[] { new RegistryDocumentationHandler_Default() })); } }
/// <summary> /// Generate a <see cref="Command"/> documentation using the Khronos reference pages. /// </summary> /// <param name="sw"> /// A <see cref="SourceStreamWriter"/> used to write the documentation of <paramref name="command"/>. /// </param> /// <param name="ctx"> /// A <see cref="RegistryContext"/> that defines the OpenGL specification. /// </param> /// <param name="command"> /// The <see cref="Command"/> to be documented. /// </param> /// <param name="fail"></param> public static void GenerateDocumentation(this ICollection <IRegistryDocumentation> docs, SourceStreamWriter sw, RegistryContext ctx, Command command, bool fail, List <CommandParameter> commandParams) { if (docs == null || docs.Count == 0) { return; } List <IRegistryDocumentation> validDocs = GetDocRegistries(docs, command); if (validDocs.Count > 0) { if (validDocs.Count > 1) { List <RegistryDocumentationHandler> handlers = new List <RegistryDocumentationHandler>(); foreach (IRegistryDocumentation docRegistry in validDocs) { List <RegistryDocumentationHandler> registryHandlers = docRegistry.GetDocumentationHandlers(command); if (registryHandlers != null) { handlers.AddRange(registryHandlers); } } RegistryDocumentation.GenerateDocumentation(sw, ctx, command, fail, commandParams, handlers); } else { validDocs[0].GenerateDocumentation(sw, ctx, command, fail, commandParams); } } else { RegistryDocumentation.GenerateDocumentation(sw, ctx, command, fail, commandParams, new List <RegistryDocumentationHandler>(new RegistryDocumentationHandler[] { new RegistryDocumentationHandler_Default() })); } }
public static void GenerateDocumentation(this ICollection <IRegistryDocumentation> docs, SourceStreamWriter sw, RegistryContext ctx, Enumerant enumerant) { if (docs == null || docs.Count == 0) { return; } List <IRegistryDocumentation> validDocs = GetDocRegistries(docs, enumerant); if (validDocs.Count > 0) { if (validDocs.Count > 1) { List <RegistryDocumentationHandler> handlers = new List <RegistryDocumentationHandler>(); foreach (IRegistryDocumentation docRegistry in validDocs) { List <RegistryDocumentationHandler> registryHandlers = docRegistry.GetDocumentationHandlers(enumerant); if (registryHandlers != null) { handlers.AddRange(registryHandlers); } } RegistryDocumentation.GenerateDocumentation(sw, ctx, enumerant, handlers); } else { validDocs[0].GenerateDocumentation(sw, ctx, enumerant); } } else { RegistryDocumentation.GenerateDocumentation(sw, ctx, enumerant, new List <RegistryDocumentationHandler>(new RegistryDocumentationHandler[] { new RegistryDocumentationHandlerDefault() })); } }