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


C# TransformationData类代码示例

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


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


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