• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TransformationData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TransformationData的典型用法代码示例。如果您正苦于以下问题:C# TransformationData类的具体用法?C# TransformationData怎么用?C# TransformationData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TransformationData类属于命名空间,在下文中一共展示了TransformationData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FilterOut

        public string FilterOut(string text, TransformationData data, PreprocessedData preprocessedData)
        {
            var map = preprocessedData.TextMap;

            try
            {
                foreach (var element in elements)
                {
                    var changes = new List<PreprocessingTextChange>();

                    text = element.Pattern.Replace(text, m => FilterEvaluator(m, element.Predicate, changes));

                    Preprocessor.AddChangesToBounds(map, changes, preprocessedData, PreprocessedTextType.FilteredOut);

                    map.ApplyChanges(changes);
                }
            }
            catch (FilterPredicateException e)
            {
                data.ErrorList.Add(Markdown.GenerateError(
                    e.Message, MessageClass.Error, "", 0, data));
            }

            return text;
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:25,代码来源:Filter.cs


示例2: Preprocess

        public string Preprocess(string text, TransformationData transData, PreprocessedData data, string relativePathToLinkedFile = null, bool full = true)
        {
            var relPath = relativePathToLinkedFile ?? transData.CurrentFolderDetails.CurrentFolderFromMarkdownAsTopLeaf;

            text = Normalizer.Normalize(text, data.TextMap);

            text = OffensiveWordFilterHelper.CheckAndGenerateInfos(text, data.TextMap);

            text = EscapeChars(text, data.TextMap);

            text = DoCodeSpans(text, data.TextMap);

            text = data.Metadata.ParseMetadata(text, transData, data, full);

            text = filter.FilterOut(text, transData, data);

            text = data.Variables.ParseVariablesDefinition(text, relPath, transData, data.TextMap);

            data.ExcerptTextMap = new PreprocessedTextLocationMap(data.TextMap);
            text = data.Excerpts.ParseExcerpts(text, transData, data.TextMap);

            text = data.ReferenceLinks.Parse(text, data);

            text = CutoutComments(text, data);

            return text;
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:27,代码来源:Preprocessor.cs


示例3: AppendHTML

 public override void AppendHTML(StringBuilder builder, Stack<EMInclude> includesStack, TransformationData data)
 {
     builder.Append(
         Templates.Region.Render(
             Hash.FromAnonymousObject(
                 new { regionParameters = RegionParam, regionContent = Elements.GetInnerHTML(includesStack, data), singleLine })));
 }
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:7,代码来源:EMRegion.cs


示例4: EMDocument

 public EMDocument(string path, TransformationData data)
 {
     LocalPath = path;
     TransformationData = data;
     preprocessedData = new PreprocessedData(this, data.ProcessedDocumentCache);
     publish = false;
 }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:7,代码来源:EMDocument.cs


示例5: AddToErrorList

        public int AddToErrorList(TransformationData data, string originalText)
        {
            var errorId = data.ErrorList.Count;
            data.ErrorList.Add(Markdown.GenerateError(Message, MessageClass.Error, originalText, errorId, data));

            return errorId;
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:7,代码来源:EMPathVerificationException.cs


示例6: ParseVariableDefinition

        private string ParseVariableDefinition(Match everyMatch, string relPath, TransformationData data)
        {
            var value = everyMatch.Groups["variableContent"].Value.Replace("<a name=\"MARKDOWNANCHORNOTUSEDELSEWHERE\"></a>", "");

            Add(everyMatch.Groups["variableName"].Value.ToLower(), value, data, relPath);

            return "";
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:8,代码来源:VariableManager.cs


示例7: CreateRegion

        public static EMElement CreateRegion(EMElementOrigin origin, EMDocument doc, EMElement parent, TransformationData data, EMMarkdownTaggedElementMatch match, string regionParameters)
        {
            var content = new EMRegion(doc, origin, parent, match, regionParameters);

            content.Elements.Parse(0, Markdown.OutdentIfPossible(match.Content, content.Elements.TextMap), data);

            return content;
        }
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:8,代码来源:EMRegion.cs


示例8: CreateDecoration

        private static EMElement CreateDecoration(IMatch match, EMDocument doc, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var decorationMatch = match as EMDecorationMatch;

            var element = new EMDecorationElement(doc, origin, parent, decorationMatch.Type);
            element.Content.Parse(decorationMatch.ContentStart, decorationMatch.Content, data);

            return element;
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:9,代码来源:EMSpanParser.cs


示例9: EMLocalFilePath

        public EMLocalFilePath(string userPath, EMDocument doc, TransformationData data, Func<string, string> outputFileNameConversion = null)
        {
            userPath = Preprocessor.UnescapeChars(userPath, true);

            if (userPath.StartsWith("%ROOT%"))
            {
                userPath = userPath.Replace("%ROOT%", ".");
            }

            if (outputFileNameConversion == null)
            {
                outputFileNameConversion = NoConversion;
            }

            var localized = data.CurrentFolderDetails.Language != "INT";
            IsImage = ImageExtensionPattern.IsMatch(userPath);

            var sourceDocDir = GetDirectoryName(userPath, doc, data);
            var fileName = Path.GetFileName(userPath);

            absolutePath = GetAbsoluteFilePath(sourceDocDir, fileName, data, localized);
            dstRelative = localized
                              ? Path.Combine(
                                  GetFolderTypeName(),
                                  sourceDocDir,
                                  data.CurrentFolderDetails.Language,
                                  outputFileNameConversion(Path.GetFileName(userPath)))
                              : Path.Combine(
                                  GetFolderTypeName(),
                                  sourceDocDir,
                                  outputFileNameConversion(Path.GetFileName(userPath)));

            if (!File.Exists(absolutePath))
            {
                if (localized)
                {
                    absolutePath = GetAbsoluteFilePath(sourceDocDir, fileName, data, false);
                    changedLanguage = File.Exists(absolutePath);
                }

                if (!localized || !changedLanguage)
                {
                    throw new EMPathVerificationException(
                        Language.Message(
                            string.Format(
                                "{0}FileNotFoundIn{1}INTDir",
                                IsImage ? "Image" : "Attachment",
                                data.CurrentFolderDetails.Language != "INT" ? "LanguageOr" : ""),
                            absolutePath));
                }

                dstRelative = Path.Combine(
                    GetFolderTypeName(),
                    sourceDocDir,
                    outputFileNameConversion(Path.GetFileName(userPath)));
            }
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:57,代码来源:EMLocalFilePath.cs


示例10: CreateFromSetextMatch

        private static EMHeader CreateFromSetextMatch(Match match, EMDocument doc, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var headerText = match.Groups[2].Value;
            var level = match.Groups[3].Value.StartsWith("=") ? 1 : 2;
            var isOptional = string.IsNullOrWhiteSpace(match.Groups[1].Value);

            headerText = Markdown.Unescape(data.Markdown.RunSpanGamut(headerText, data));

            return new EMHeader(doc, origin, parent, level, headerText, isOptional);
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:10,代码来源:EMHeader.cs


示例11: Create

 public static EMErrorElement Create(
     EMDocument doc,
     EMElementOrigin origin,
     EMElement parent,
     TransformationData data,
     string messageId,
     params string[] messageArgs)
 {
     return new EMErrorElement(doc, origin, parent, new EMReadingMessage(MessageClass.Error, messageId, messageArgs), data);
 }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:10,代码来源:EMErrorElement.cs


示例12: AppendHTML

 public override void AppendHTML(StringBuilder builder, Stack<EMInclude> includesStack, TransformationData data)
 {
     builder.Append(Templates.CustomTag.Render(Hash.FromAnonymousObject(
         new
             {
                 tagName = name,
                 attributesList = attributesString,
                 content = Elements.GetInnerHTML(includesStack, data)
             })));
 }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:10,代码来源:EMRawHTML.cs


示例13: AppendHTML

 public override void AppendHTML(StringBuilder builder, Stack<EMInclude> includesStack, TransformationData data)
 {
     try
     {
         builder.Append(path.GetPath(data).Replace("\\", "/"));
     }
     catch (EMPathVerificationException e)
     {
         e.AddToErrorListAndAppend(builder, data, Origin.Text);
     }
 }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:11,代码来源:EMRelativeLink.cs


示例14: AddToErrorListAndAppend

        public void AddToErrorListAndAppend(StringBuilder builder, TransformationData data, string originalText)
        {
            var errorId = AddToErrorList(data, originalText);

            if (data.Markdown.ThisIsPreview)
            {
                builder.Append(
                    Templates.ErrorHighlight.Render(
                        Hash.FromAnonymousObject(new { errorText = originalText, errorId })));
            }
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:11,代码来源:EMPathVerificationException.cs


示例15: AppendHTML

        public override void AppendHTML(StringBuilder builder, Stack<EMInclude> includesStack, TransformationData data)
        {
            var content = Elements.GetInnerHTML(includesStack, data);

            content = NewlinePattern.Replace(content, "  ");

            // These leading spaces screw with <pre> content, so we need to fix that:
            content = PreTagPattern.Replace(content, BlockQuotePreLeadingSpacesFix);

            builder.Append(Templates.Blockquote.Render(Hash.FromAnonymousObject(new { value = content })));
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:11,代码来源:EMBlockQuotes.cs


示例16: ParseElements

        public static void ParseElements(
            TransformationData data,
            EMDocument doc,
            EMElement parent,
            string text,
            IParser parser,
            Action<EMElement> elementEmitter)
        {
            var fragments = new List<TextFragment> { new TextFragment(0, text) };

            ParseElements(data, doc, parent, fragments, parser, elementEmitter);
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:12,代码来源:EMParsingHelper.cs


示例17: CreateFromText

        public static EMElement CreateFromText(string text, EMDocument doc, EMElementOrigin origin, EMElement parent, TransformationData data, bool imageLink = false)
        {
            try
            {
                var path = EMPathProvider.CreatePath(text, doc, data);

                return new EMRelativeLink(doc, origin, parent, path);
            }
            catch (EMPathVerificationException e)
            {
                return new EMErrorElement(doc, origin, parent, e.AddToErrorList(data, origin.Text));
            }
        }
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:13,代码来源:EMRelativeLink.cs


示例18: CreateItem

        private static EMElement CreateItem(EMListType type, EMDocument doc, Match match, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var itemGroup = match.Groups[4];

            var item = new EMListItem(doc, origin, parent, type);

            // adding offset to text map
            item.Elements.TextMap.ApplyChanges(new List<PreprocessingTextChange>() { new PreprocessingTextChange(0, itemGroup.Index - match.Index, 0) });

            item.Elements.Parse(0, Markdown.Outdent(itemGroup.Value, item.Elements.TextMap), data);

            return item;
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:13,代码来源:EMListItem.cs


示例19: Create

        private static EMElement Create(Match match, EMDocument doc, EMElementOrigin origin, EMElement parent, TransformationData data)
        {
            var bqTextGroup = match.Groups[1];
            var bqText = bqTextGroup.Value;

            bqText = Regex.Replace(bqText, @"^[ ]*>[ ]?", "", RegexOptions.Multiline);       // trim one level of quoting
            bqText = Regex.Replace(bqText, @"^[ ]+$", "", RegexOptions.Multiline);           // trim whitespace-only lines

            var bq = new EMBlockQuotes(doc, origin, parent);

            bq.Elements.Parse(origin.Start + bqTextGroup.Index, bqText, data);

            return bq;
        }
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:14,代码来源:EMBlockQuotes.cs


示例20: Parse

 public override void Parse(List<TextFragment> fragments, TransformationData data)
 {
     ParseElements(data, fragments, new EMMarkdownAndHTMLTagsParser(GetLocation));
     ParseElements(data, fragments, EMHeader.GetParser());
     ParseElements(data, fragments, EMInclude.GetParser());
     ParseElements(data, fragments, EMTOCInline.GetParser());
     ParseElements(data, fragments, EMBookmark.GetParser());
     ParseElements(data, fragments, EMHorizontalRule.GetParser());
     ParseElements(data, fragments, EMList.GetParser());
     ParseElements(data, fragments, EMTable.GetParser());
     ParseElements(data, fragments, EMCodeBlock.GetParser());
     ParseElements(data, fragments, EMBlockQuotes.GetParser());
     ParseElements(data, fragments, EMParagraph.GetParser());
 }
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:14,代码来源:EMElements.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Transition类代码示例发布时间:2022-05-24
下一篇:
C# Transformation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap