示例#1
0
        public void Set(ModInfoHolder Mod, DescType WindowType, string Title, string Message, string WindowTitle = null)
        {
            this.Mod = Mod;
            LocalModInfoArea.Visible  = false;
            ServerModInfoArea.Visible = false;
            UpdateInfoArea.Visible    = false;
            switch (WindowType)
            {
            case DescType.LocalModInfo: LocalModInfoArea.Visible = true; break;

            case DescType.ServerModInfo: ServerModInfoArea.Visible = true; break;

            case DescType.UpdateInfo: UpdateInfoArea.Visible = true; break;
            }
            labelTitle.Markup    = "<b>" + Title + "</b>";
            labelTextView.Text   = "";
            labelTextView.Markup = MarkdownConvert.ToPangoString(Message);
            if (string.IsNullOrWhiteSpace(labelTextView.Text))
            {
                labelTextView.Text = Message;
            }
            if (string.IsNullOrWhiteSpace(WindowTitle))
            {
                this.Title = "TTMM - " + Title;
            }
            else
            {
                this.Title = "TTMM - " + WindowTitle;
            }
        }
示例#2
0
        /// <summary>
        /// 异步访问并呈现当前标签实例。
        /// </summary>
        /// <param name="context">当前HTML标签上下文,包含当前HTML相关信息。</param>
        /// <param name="output">当前标签输出实例,用于呈现标签相关信息。</param>
        public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = null;
            var content = await output.GetChildContentAsync();

            if (content.IsEmptyOrWhiteSpace)
            {
                return;
            }
            var source = content.GetContent().Trim();

            source = MarkdownConvert.ToHtml(source, Extensions);
            output.AppendHtml(source);
        }
示例#3
0
        public static IEnumerable <PSObject> ConvertFromMarkdown(PSObject sourceObject, VisitTargetObject next)
        {
            // Only attempt to deserialize if the input is a string or a file
            if (!IsAcceptedType(sourceObject: sourceObject))
            {
                return new PSObject[] { sourceObject }
            }
            ;

            var markdown = ReadAsString(sourceObject, out PSSourceInfo source);
            var value    = MarkdownConvert.DeserializeObject(markdown);

            NoteSource(value, source);
            return(VisitItems(value, next));
        }
示例#4
0
 protected void OnChanged(object sender, EventArgs e)
 {
     labelTextView.Markup = MarkdownConvert.ToPangoString(entry3.Text.Replace("\\n", "\n"));
 }