public void CreateApiDoc(SDRepository sdRepository, int navigationLevel) { foreach (var sdNamespace in sdRepository.GetAllNamespaces()) { _namespaceBuilder.InsertNamespace(sdNamespace, navigationLevel); } }
internal void ExecuteOnParseCompleted(SDRepository repository) { if (OnParseCompleted != null) { OnParseCompleted(repository); } }
public MethodVisitor(SDRepository repository, SDMethod method, SDType type, CSharpFile file) { _repository = repository; _method = method; _type = type; _file = file; _tokenList = method.Calls; }
private void CreateNamespaceNavs(SDRepository repository, IStrings strings, string outputPath) { foreach (var sdNamespace in repository.GetAllNamespaces()) { var namespaceTemplate = new NamespaceNavTemplate { Namespace = sdNamespace, Strings = strings, ApiUrl = repository.Articles.Count == 0 ? "index" : "api" }; File.WriteAllText(Path.Combine(outputPath, "nav", sdNamespace.Fullname + ".html"), namespaceTemplate.TransformText()); } }
public SequenceDiagram(SDRepository sdRepository) { _sdRepository = sdRepository; _sequenceDiagramPngRenderer = new SequenceDiagramPngRenderer(); _sequenceDiagramSvgRenderer = new SequenceDiagramSvgRenderer(); Nodes = new List<SequenceDiagramNode>(); }
public void ExportSolution(SDRepository repository) { _buildMessenger.ExecuteOnStepProgress(0); _buildMessenger.ExecuteOnStepMessage(string.Empty); RunAllExporters(repository); _buildMessenger.ExecuteOnStepProgress(100); }
public CSharpMethodVisitor(SDRepository repository, SDMethod method, SDType type, Document file) : base(SyntaxWalkerDepth.StructuredTrivia) { _repository = repository; _method = method; _type = type; _file = file; _tokenList = method.Calls; }
private void CreateArticleNavs(SDRepository repository, IStrings strings, string currentLanguage, string outputPath) { if (repository.Articles.Count > 0) { var articles = repository.Articles.ContainsKey(currentLanguage) ? repository.Articles[currentLanguage] : repository.Articles["default"]; CreateArticleNavs(articles, repository, strings, currentLanguage, outputPath); } }
public override void ProcessStep(ChmExporter chmExporter) { _tmpFilepath = chmExporter.TmpPath; _currentLanguage = chmExporter.CurrentLanguage; _repository = chmExporter.Repository; _chmConfig = chmExporter.ChmConfig; _strings = chmExporter.CurrentStrings; chmExporter.ExecuteOnStepProgress(10); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateStylesheet); CreateStylesheet(); chmExporter.ExecuteOnStepProgress(15); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateIndex); CreateIndexFile(); chmExporter.ExecuteOnStepProgress(20); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateToc); CreateTocFile(); chmExporter.ExecuteOnStepProgress(25); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProject); CreateProjectFile(); chmExporter.ExecuteOnStepProgress(30); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateArticles); CreateArticleFiles(); chmExporter.ExecuteOnStepProgress(35); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateNamespaces); CreateNamespaceFiles(); chmExporter.ExecuteOnStepProgress(40); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateTypes); CreateTypeFiles(); chmExporter.ExecuteOnStepProgress(45); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateFields); CreateFieldFiles(); chmExporter.ExecuteOnStepProgress(50); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateEvents); CreateEventFiles(); chmExporter.ExecuteOnStepProgress(55); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProperties); CreatePropertyFiles(); chmExporter.ExecuteOnStepProgress(60); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateMethods); CreateMethodFiles(); chmExporter.CurrentStep = new CompileStep(); }
/// <default> /// <summary> /// Gets an existing <see cref="SDRepository"/> with the given target framework. /// Or adds and returns a new one. /// </summary> /// <param name="targetFx">The target framework of the <see cref="SDRepository"/>.</param> /// <returns>Existing or new <see cref="SDRepository"/> with the given target framework.</returns> /// </default> /// <de> /// <summary> /// Liefert ein neues oder bestehendes <see cref="SDRepository"/> mit dem gegebenen Framework. /// </summary> /// <param name="targetFx">Das Zielframework des <see cref="SDRepository"/>.</param> /// <returns>Neues oder bestehendes <see cref="SDRepository"/>.</returns> /// </de> public SDRepository GetExistingOrNew(SDTargetFx targetFx) { var sdRepository = Repositories.SingleOrDefault(r => r.TargetFx == targetFx); if (sdRepository == null) { sdRepository = new SDRepository(); sdRepository.TargetFx = targetFx; Repositories.Add(sdRepository); } return sdRepository; }
public SDRepository ParseStructure(CSharpSolution solution) { _solution = solution; _repository = new SDRepository(); _buildMessenger.ExecuteOnStepProgress(0); _buildMessenger.ExecuteOnBuildMessage(_sdBuildStrings.ParsingSolution); ParseNamespaces(); ParseTypes(); _buildMessenger.ExecuteOnStepProgress(100); return _repository; }
private void CreateArticle(SDArticle article, SDRepository repository, IStrings strings, string outputPath) { if (!string.IsNullOrEmpty(article.Content) && article.Content != "SDDoc") { var articleTemplate = new ArticleTemplate { Repository = repository, Article = article, Strings = strings }; File.WriteAllText(Path.Combine(outputPath, "article", string.Format("{0}.html", article.Title.Replace(" ", "_"))), articleTemplate.TransformText()); } if (article.Content != "SDDoc") { foreach (var child in article.Children) { CreateArticle(child, repository, strings, outputPath); } } }
private void RunAllExporters(SDRepository repository) { var i = 0; foreach (var exporter in _allExporters) { _buildMessenger.ExecuteOnBuildMessage(string.Format(_sdBuildStrings.StartExporter + ": \"{0}\" ...", exporter.ExporterName)); var outputPath = GetOutputPath(_sharpDoxConfig.OutputPath, exporter.ExporterName); exporter.OnStepMessage += (m) => _buildMessenger.ExecuteOnStepMessage(m); exporter.OnStepProgress += (p) => _buildMessenger.ExecuteOnStepProgress(p); exporter.Export(repository, outputPath); PostProgress(i++); } }
public override void ProcessStep(ChmExporter chmExporter) { _repository = chmExporter.Repository; _currentLanguage = chmExporter.CurrentLanguage; _tmpPath = chmExporter.TmpPath; chmExporter.ExecuteOnStepProgress(90); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Saving); SaveTo(chmExporter.OutputPath, 0); chmExporter.ExecuteOnStepProgress(95); chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Cleaning); CleanUp(); chmExporter.ExecuteOnStepProgress(100); chmExporter.CurrentStep = null; }
private void CreateArticleNavs(IEnumerable<SDArticle> articles, SDRepository repository, IStrings strings, string currentLanguage, string outputPath) { foreach (var article in articles) { if (article.Children.Count > 0) { var artivleNavTemplate = new ArticleNavTemplate { Article = article, Repository = repository, Strings = strings, CurrentLanguage = currentLanguage }; File.WriteAllText(Path.Combine(outputPath, "nav", article.Title.Replace(" ", "_") + ".html"), artivleNavTemplate.TransformText()); CreateArticleNavs(article.Children, repository, strings, currentLanguage, outputPath); } else if (article.Content == "SDDoc") { var apiNavWrapperTemplate = new ApiNavWrapperTemplate { Article = article, Repository = repository, Strings = strings, CurrentLanguage = currentLanguage }; File.WriteAllText(Path.Combine(outputPath, "nav", "api.html"), apiNavWrapperTemplate.TransformText()); } } }
public void Export(SDRepository repository, string outputPath) { foreach (var documentationLanguage in repository.DocumentationLanguages) { Repository = repository; CurrentLanguage = documentationLanguage; OutputPath = Path.Combine(outputPath, CurrentLanguage); CurrentStrings = GetCurrentStrings(); CurrentStep = new PreBuildStep(); while (CurrentStep != null) { CurrentStep.ProcessStep(this); } ExecuteOnStepProgress(100); } }
private void ParseCompleted(SDRepository repository) { Application.Current.Dispatcher.Invoke( DispatcherPriority.Background, new Action(() => { TreeView = new VisibilityItemList(); if (repository != null) { foreach (var sdNamespace in repository.GetAllNamespaces()) { TreeView.Add(new NamespaceViewModel(sdNamespace, _sharpDoxConfig.ExcludedIdentifiers)); } } IsTreeRefreshing = false; })); }
public SDRepository ParseSolution(CSharpSolution solution, List<string> excludedIdentifiers) { _solution = solution; _excludedIdentifiers = excludedIdentifiers ?? new List<string>(); _repository = new SDRepository(); _buildMessenger.ExecuteOnStepProgress(0); _buildMessenger.ExecuteOnBuildMessage(_sdBuildStrings.ParsingSolution); GetProjectInfos(); GetImages(); ParseNamespaces(); ParseTypes(); ParseArticles(); ParseMethodCalls(); ResolveUses(); _buildMessenger.ExecuteOnStepProgress(100); return _repository; }
public static void AddKnownTypes(SDRepository sdRepository) { var systemNamespace = sdRepository.GetNamespaceByIdentifier("System"); if(systemNamespace != null) { sdRepository.AddType(new SDType("System.Object", "Object", systemNamespace) { IsProjectStranger = true, CSharpName = "object" }); sdRepository.AddType(new SDType("System.Boolean", "Boolean", systemNamespace) { IsProjectStranger = true, CSharpName = "bool" }); sdRepository.AddType(new SDType("System.Char", "Char", systemNamespace) { IsProjectStranger = true, CSharpName = "char" }); sdRepository.AddType(new SDType("System.SByte", "SByte", systemNamespace) { IsProjectStranger = true, CSharpName = "sbyte" }); sdRepository.AddType(new SDType("System.Byte", "Byte", systemNamespace) { IsProjectStranger = true, CSharpName = "byte" }); sdRepository.AddType(new SDType("System.Int16", "Int16", systemNamespace) { IsProjectStranger = true, CSharpName = "short" }); sdRepository.AddType(new SDType("System.UInt16", "UInt16", systemNamespace) { IsProjectStranger = true, CSharpName = "ushort" }); sdRepository.AddType(new SDType("System.Int32", "Int32", systemNamespace) { IsProjectStranger = true, CSharpName = "int" }); sdRepository.AddType(new SDType("System.UInt32", "UInt32", systemNamespace) { IsProjectStranger = true, CSharpName = "uint" }); sdRepository.AddType(new SDType("System.Int64", "Int64", systemNamespace) { IsProjectStranger = true, CSharpName = "long" }); sdRepository.AddType(new SDType("System.UInt64", "UInt64", systemNamespace) { IsProjectStranger = true, CSharpName = "ulong" }); sdRepository.AddType(new SDType("System.Single", "Single", systemNamespace) { IsProjectStranger = true, CSharpName = "float" }); sdRepository.AddType(new SDType("System.Double", "Double", systemNamespace) { IsProjectStranger = true, CSharpName = "double" }); sdRepository.AddType(new SDType("System.Decimal", "Decimal", systemNamespace) { IsProjectStranger = true, CSharpName = "decimal" }); sdRepository.AddType(new SDType("System.String", "String", systemNamespace) { IsProjectStranger = true, CSharpName = "string" }); sdRepository.AddType(new SDType("System.Void", "Void", systemNamespace) { IsProjectStranger = true, CSharpName = "void" }); } }
public SequenceDiagramParser(SDMethod method, SDRepository sdRepository = null) { _method = method; _sdRepository = sdRepository; }
public static void AddKnownNamespaces(SDRepository sdRepository) { sdRepository.AddNamespace(new SDNamespace("System") { IsProjectStranger = true }); }
internal TypeParser(SDRepository repository, List<string> excludedIdentifiers) : base(repository, excludedIdentifiers) { }
internal MethodCallParser(SDRepository repository, CSharpSolution solution) : base(repository) { _solution = solution; }
public DocumentationParser(SDRepository sdRepository) { _sdRepository = sdRepository; }
internal NamespaceParser(SDRepository repository, ICoreConfigSection sharpDoxConfig, string inputFile, Dictionary<string, string> tokens) : base(repository, sharpDoxConfig) { _descriptionFiles = Directory.EnumerateFiles(Path.GetDirectoryName(inputFile), "*.sdnd", SearchOption.AllDirectories).ToList(); _tokens = tokens; }
/// <default> /// <summary> /// The constructor takes two parameters. /// You have to create a new instance /// for each text you want to transform. /// </summary> /// <param name="template">The text you want to transform.</param> /// </default> /// <de> /// <summary> /// The Konstruktor akzeptiert zwei Parameter. /// Für jeden Text der transformiert werden soll /// muss eine neue Instanz erstellt werden. /// </summary> /// <param name="template">Der Text der transformiert werden soll.</param> /// </de> public Templater(SDRepository repository, string template) { _repository = repository; _template = template; }
internal PropertyParser(SDRepository repository, TypeParser typeParser, ICoreConfigSection sharpDoxConfig) : base(repository, sharpDoxConfig) { _typeParser = typeParser; }
private void CreateIndexNav(SDRepository repository, IStrings strings, string currentLanguage, string outputPath) { var indexNavTemplate = new IndexNavTemplate { Repository = repository, Strings = strings, CurrentLanguage = currentLanguage }; File.WriteAllText(Path.Combine(outputPath, "nav", "index.html"), indexNavTemplate.TransformText()); }
internal UseParser(SDRepository repository) : base(repository) { }
internal MethodParser(SDRepository repository, TypeParser typeParser, List<string> excludedIdentifiers) : base(repository, excludedIdentifiers) { _typeParser = typeParser; }