Example #1
0
 public void CreateApiDoc(SDRepository sdRepository, int navigationLevel)
 {
     foreach (var sdNamespace in sdRepository.GetAllNamespaces())
     {
         _namespaceBuilder.InsertNamespace(sdNamespace, navigationLevel);
     }
 }
Example #2
0
 internal void ExecuteOnParseCompleted(SDRepository repository)
 {
     if (OnParseCompleted != null)
     {
         OnParseCompleted(repository);
     }
 }
Example #3
0
		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());
     }
 }
Example #5
0
        public SequenceDiagram(SDRepository sdRepository)
        {
            _sdRepository = sdRepository;
            _sequenceDiagramPngRenderer = new SequenceDiagramPngRenderer();
            _sequenceDiagramSvgRenderer = new SequenceDiagramSvgRenderer();

            Nodes = new List<SequenceDiagramNode>();
        }
Example #6
0
        public void ExportSolution(SDRepository repository)
        {
            _buildMessenger.ExecuteOnStepProgress(0);
            _buildMessenger.ExecuteOnStepMessage(string.Empty);

            RunAllExporters(repository);

            _buildMessenger.ExecuteOnStepProgress(100);
        }
Example #7
0
 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);
     }
 }
Example #9
0
        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();
        }
Example #10
0
 /// <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;
 }
Example #11
0
        public SDRepository ParseStructure(CSharpSolution solution)
        {
            _solution = solution;
            _repository = new SDRepository();

            _buildMessenger.ExecuteOnStepProgress(0);
            _buildMessenger.ExecuteOnBuildMessage(_sdBuildStrings.ParsingSolution);

            ParseNamespaces();
            ParseTypes();

            _buildMessenger.ExecuteOnStepProgress(100);

            return _repository;
        }
Example #12
0
        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);
                }
            }
        }
Example #13
0
        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++);
            }
        }
Example #14
0
        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());
                }
            }
        }
Example #16
0
        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);
            }
        }
Example #17
0
        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;
                }));
        }
Example #18
0
        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;
        }
Example #19
0
 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" });
     }
 }
Example #20
0
 public SequenceDiagramParser(SDMethod method, SDRepository sdRepository = null)
 {
     _method = method;
     _sdRepository = sdRepository;
 }
Example #21
0
 public static void AddKnownNamespaces(SDRepository sdRepository)
 {
     sdRepository.AddNamespace(new SDNamespace("System") { IsProjectStranger = true });
 }
Example #22
0
 internal TypeParser(SDRepository repository, List<string> excludedIdentifiers) : base(repository, excludedIdentifiers) { }
Example #23
0
 internal MethodCallParser(SDRepository repository, CSharpSolution solution)
     : base(repository) 
 {
     _solution = solution;
 }
Example #24
0
	    public DocumentationParser(SDRepository sdRepository)
	    {
	        _sdRepository = sdRepository;
	    }
Example #25
0
 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;
 }
Example #26
0
 /// <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;
 }
Example #27
0
 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());
 }
Example #29
0
 internal UseParser(SDRepository repository) : base(repository) { }
Example #30
0
 internal MethodParser(SDRepository repository, TypeParser typeParser, List<string> excludedIdentifiers)
     : base(repository, excludedIdentifiers)
 {
     _typeParser = typeParser;
 }