public static DslModel Build(DocumentModel model) { Dictionary <string, SummaryComment> summaries; var data = GetData(model, out summaries); var categories = new List <DslCategory>(); foreach (var categoryName in data.Keys) { var metadata = (IDocumentationMetadata)null; var categoryMethods = new List <DocumentedMethod>(); var subCategories = new List <DslSubCategory>(); foreach (var subCategoryName in data[categoryName].Keys) { var methods = data[categoryName][subCategoryName]; if (string.IsNullOrWhiteSpace(subCategoryName)) { categoryMethods.AddRange(methods.OrderBy(x => x.Identity)); } else { subCategories.Add(new DslSubCategory(subCategoryName, methods)); } if (metadata == null) { metadata = methods.First().Metadata; } } SummaryComment summary = null; if (summaries.ContainsKey(categoryName)) { summary = summaries[categoryName]; } categories.Add( new DslCategory( categoryName, metadata, summary, categoryMethods, subCategories.OrderBy(x => x.Name))); } var dslModel = new DslModel(categories.OrderBy(x => x.Name)); foreach (var category in dslModel.Categories) { category.Parent = dslModel; } return(dslModel); }
public static DslModel Build(DocumentModel model) { Dictionary<string, SummaryComment> summaries; var data = GetData(model, out summaries); var categories = new List<DslCategory>(); foreach (var categoryName in data.Keys) { var metadata = (IDocumentationMetadata)null; var categoryMethods = new List<DocumentedMethod>(); var subCategories = new List<DslSubCategory>(); foreach (var subCategoryName in data[categoryName].Keys) { var methods = data[categoryName][subCategoryName]; if (string.IsNullOrWhiteSpace(subCategoryName)) { categoryMethods.AddRange(methods.OrderBy(x => x.Identity)); } else { subCategories.Add(new DslSubCategory(subCategoryName, methods)); } if (metadata == null) { metadata = methods.First().Metadata; } } SummaryComment summary = null; if (summaries.ContainsKey(categoryName)) { summary = summaries[categoryName]; } categories.Add( new DslCategory( categoryName, metadata, summary, categoryMethods, subCategories.OrderBy(x => x.Name))); } var dslModel = new DslModel(categories.OrderBy(x => x.Name)); foreach (var category in dslModel.Categories) { category.Parent = dslModel; } return dslModel; }
public DslController(DslModel model) { _model = model; }
public ContentProcessor(IUrlResolver resolver, DslModel dslModel) { _resolver = resolver; _dslModel = dslModel; }