当前位置: 首页>>代码示例>>C#>>正文


C# GeneralTree.AcceptVisitor方法代码示例

本文整理汇总了C#中GeneralTree.AcceptVisitor方法的典型用法代码示例。如果您正苦于以下问题:C# GeneralTree.AcceptVisitor方法的具体用法?C# GeneralTree.AcceptVisitor怎么用?C# GeneralTree.AcceptVisitor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeneralTree的用法示例。


在下文中一共展示了GeneralTree.AcceptVisitor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Build

        public void Build(GeneralTree<INode> features)
        {
            if (log.IsInfoEnabled)
            {
              log.Info("Writing HTML to {0}", this.configuration.OutputFolder.FullName);
            }

            this.htmlResourceWriter.WriteTo(this.configuration.OutputFolder.FullName);


            var actionVisitor = new ActionVisitor<INode>(node => this.VisitNodes(features, node));
            if (features != null)
                features.AcceptVisitor(actionVisitor);
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:14,代码来源:HtmlDocumentationBuilder.cs

示例2: Build

        public void Build(GeneralTree<IDirectoryTreeNode> features)
        {
            this.ditaMapBuilder.Build(features);

            var actionVisitor = new ActionVisitor<IDirectoryTreeNode>(node =>
                                                                          {
                                                                              var featureDirectoryTreeNode =
                                                                                  node as FeatureDirectoryTreeNode;
                                                                              if (featureDirectoryTreeNode != null)
                                                                              {
                                                                                  this.ditaFeatureFormatter.Format(
                                                                                      featureDirectoryTreeNode);
                                                                              }
                                                                          });

            features.AcceptVisitor(actionVisitor);
        }
开发者ID:timblinkbox,项目名称:pickles,代码行数:17,代码来源:DitaDocumentationBuilder.cs

示例3: ApplyTestResultsToFeatures

        private static void ApplyTestResultsToFeatures(IContainer container, Configuration configuration, GeneralTree<INode> features)
        {
            var testResults = container.Resolve<ITestResults>();

            var actionVisitor = new ActionVisitor<INode>(node =>
                {
                    var featureTreeNode = node as FeatureNode;
                    if (featureTreeNode == null) return;
                    if (configuration.HasTestResults)
                    {
                        SetResultsAtFeatureLevel(featureTreeNode, testResults);
                        SetResultsForIndividualScenariosUnderFeature(featureTreeNode, testResults);
                    }
                    else
                    {
                        featureTreeNode.Feature.Result = TestResult.Inconclusive();
                    }
                });

            features.AcceptVisitor(actionVisitor);
        }
开发者ID:eduaquiles,项目名称:pickles,代码行数:21,代码来源:Runner.cs

示例4: Build

        public void Build(GeneralTree<IDirectoryTreeNode> features)
        {   
            if (log.IsInfoEnabled)
            {
                log.InfoFormat("Writing HTML to {0}", this.configuration.OutputFolder.FullName);
            }

            this.htmlResourceWriter.WriteTo(this.configuration.OutputFolder.FullName);

            var actionVisitor = new ActionVisitor<IDirectoryTreeNode>(node =>
                {
                  if (node.IsIndexMarkDownNode())
                  {
                    return;
                  }

                    var nodePath = Path.Combine(this.configuration.OutputFolder.FullName, node.RelativePathFromRoot);
                  string htmlFilePath;

                    if (node.IsContent)
                    {
                        htmlFilePath = nodePath.Replace(Path.GetExtension(nodePath), ".html");
                    }
                    else
                    {
                        Directory.CreateDirectory(nodePath);

                        htmlFilePath = Path.Combine(nodePath, "index.html");
                    }

                    using (var writer = new StreamWriter(htmlFilePath, false, Encoding.UTF8))
                    {
                      var document = this.htmlDocumentFormatter.Format(node, features, this.configuration.FeatureFolder);
                      document.Save(writer);
                      writer.Close();
                    }
                });

            features.AcceptVisitor(actionVisitor);
        }
开发者ID:drift,项目名称:pickles,代码行数:40,代码来源:HtmlDocumentationBuilder.cs

示例5: Build

        public void Build(GeneralTree<IDirectoryTreeNode> features)
        {
            if (log.IsInfoEnabled)
            {
                log.InfoFormat("Writing Excel workbook to {0}", this.configuration.OutputFolder.FullName);
            }

            string spreadsheetPath = Path.Combine(this.configuration.OutputFolder.FullName, "features.xlsx");
            using (var workbook = new XLWorkbook())
            {
                var actionVisitor = new ActionVisitor<IDirectoryTreeNode>(node =>
                                                                              {
                                                                                  var featureDirectoryTreeNode =
                                                                                      node as FeatureDirectoryTreeNode;
                                                                                  if (featureDirectoryTreeNode != null)
                                                                                  {
                                                                                      IXLWorksheet worksheet =
                                                                                          workbook.AddWorksheet(
                                                                                              this.excelSheetNameGenerator.
                                                                                                  GenerateSheetName(
                                                                                                      workbook,
                                                                                                      featureDirectoryTreeNode
                                                                                                          .Feature));
                                                                                      this.excelFeatureFormatter.Format(
                                                                                          worksheet,
                                                                                          featureDirectoryTreeNode.
                                                                                              Feature);
                                                                                  }
                                                                              });

                features.AcceptVisitor(actionVisitor);

                this.excelTableOfContentsFormatter.Format(workbook, features);

                workbook.SaveAs(spreadsheetPath);
            }
        }
开发者ID:timblinkbox,项目名称:pickles,代码行数:37,代码来源:ExcelDocumentationBuilder.cs

示例6: Build

        public void Build(GeneralTree<INode> features)
        {
            string filename = string.IsNullOrEmpty(this.configuration.SystemUnderTestName)
                ? "features.docx"
                : this.configuration.SystemUnderTestName + ".docx";
            string documentFileName = this.fileSystem.Path.Combine(this.configuration.OutputFolder.FullName, filename);
            if (this.fileSystem.File.Exists(documentFileName))
            {
                try
                {
                    this.fileSystem.File.Delete(documentFileName);
                }
                catch (System.IO.IOException ex)
                {
                    Log.Error("Cannot delete Word file. Is it still open in Word?", ex);
                    return;
                }
            }

            using (
                WordprocessingDocument wordProcessingDocument = WordprocessingDocument.Create(
                    documentFileName,
                    WordprocessingDocumentType.Document))
            {
                MainDocumentPart mainDocumentPart = wordProcessingDocument.AddMainDocumentPart();
                this.wordStyleApplicator.AddStylesPartToPackage(wordProcessingDocument);
                this.wordStyleApplicator.AddStylesWithEffectsPartToPackage(wordProcessingDocument);
                this.wordFontApplicator.AddFontTablePartToPackage(wordProcessingDocument);
                var documentSettingsPart = mainDocumentPart.AddNewPart<DocumentSettingsPart>();
                documentSettingsPart.Settings = new Settings();
                this.wordHeaderFooterFormatter.ApplyHeaderAndFooter(wordProcessingDocument);

                var document = new Document();
                var body = new Body();
                document.Append(body);

                var actionVisitor = new ActionVisitor<INode>(node =>
                {
                    var featureDirectoryTreeNode =
                        node as FeatureNode;
                    if (featureDirectoryTreeNode != null)
                    {
                        this.wordFeatureFormatter.Format(body, featureDirectoryTreeNode);
                    }
                });

                features.AcceptVisitor(actionVisitor);

                mainDocumentPart.Document = document;
                mainDocumentPart.Document.Save();
            }

            // HACK - Add the table of contents
            using (WordprocessingDocument wordProcessingDocument = WordprocessingDocument.Open(documentFileName, true))
            {
                XElement firstPara = wordProcessingDocument
                    .MainDocumentPart
                    .GetXDocument()
                    .Descendants(W.p)
                    .FirstOrDefault();

                TocAdder.AddToc(wordProcessingDocument, firstPara, @"TOC \o '1-2' \h \z \u", null, 4);
            }
        }
开发者ID:vavavivi,项目名称:pickles,代码行数:64,代码来源:WordDocumentationBuilder.cs

示例7: Build

        public void Build(GeneralTree<INode> features)
        {
            if (log.IsInfoEnabled)
            {
              log.Info("Writing JSON to {0}", this.configuration.OutputFolder.FullName);
            }

            var featuresToFormat = new List<FeatureWithMetaInfo>();

            var actionVisitor = new ActionVisitor<INode>(node =>
                                                                          {
                                                                              var featureTreeNode =
                                                                                  node as FeatureNode;
                                                                              if (featureTreeNode != null)
                                                                              {
                                                                                  if (this.configuration.HasTestResults)
                                                                                  {
                                                                                      featuresToFormat.Add(
                                                                                          new FeatureWithMetaInfo(
                                                                                              featureTreeNode,
                                                                                              this.testResults.
                                                                                                  GetFeatureResult(
                                                                                                      featureTreeNode.
                                                                                                          Feature)));
                                                                                  }
                                                                                  else
                                                                                  {
                                                                                      featuresToFormat.Add(
                                                                                          new FeatureWithMetaInfo(
                                                                                              featureTreeNode));
                                                                                  }
                                                                              }
                                                                          });

            features.AcceptVisitor(actionVisitor);

            CreateFile(this.OutputFilePath, GenerateJSON(featuresToFormat));
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:38,代码来源:JSONDocumentationBuilder.cs


注:本文中的GeneralTree.AcceptVisitor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。