コード例 #1
0
        public static System.Web.WebPages.HelperResult BeginMessage(EmphasisStyle messageType, IHtmlString heading)
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 131 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"


#line default
#line hidden

                WebViewPage.WriteLiteralTo(@__razor_helper_writer, "      <div class=\"panel ");



#line 132 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                WebViewPage.WriteTo(@__razor_helper_writer, string.Format("panel-{0}", messageType.ToString().ToLower()));

#line default
#line hidden

                WebViewPage.WriteLiteralTo(@__razor_helper_writer, "\">\r\n");



#line 133 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                if (!string.IsNullOrEmpty(heading.ToHtmlString()))
                {
#line default
#line hidden

                    WebViewPage.WriteLiteralTo(@__razor_helper_writer, "          <div class=\"panel-heading\"><h4 class=\"panel-title\">");



#line 135 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                    WebViewPage.WriteTo(@__razor_helper_writer, heading);

#line default
#line hidden

                    WebViewPage.WriteLiteralTo(@__razor_helper_writer, "</h4></div>\r\n");



#line 136 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                }

#line default
#line hidden

                WebViewPage.WriteLiteralTo(@__razor_helper_writer, "          <div class=\"panel-body\">\r\n");



#line 138 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"

#line default
#line hidden
            }));
        }
コード例 #2
0
        public static EmphasisStyle Modify(this EmphasisStyle style)
        {
            switch (style)
            {
            case EmphasisStyle.Asterisk:
                return(EmphasisStyle.Underscore);

            case EmphasisStyle.Underscore:
                return(EmphasisStyle.Asterisk);

            default:
                throw new ArgumentException(style.ToString(), nameof(style));
            }
        }
コード例 #3
0
ファイル: MarkdownFormat.cs プロジェクト: asears/DotMarkdown
 public MarkdownFormat WithItalicStyle(EmphasisStyle italicStyle)
 {
     return(new MarkdownFormat(
                BoldStyle,
                italicStyle,
                BulletListStyle,
                OrderedListStyle,
                HeadingStyle,
                HeadingOptions,
                TableOptions,
                CodeFenceStyle,
                CodeBlockOptions,
                CharEntityFormat,
                HorizontalRuleFormat));
 }
コード例 #4
0
ファイル: MarkdownFormat.cs プロジェクト: asears/DotMarkdown
        public MarkdownFormat(
            EmphasisStyle boldStyle           = EmphasisStyle.Asterisk,
            EmphasisStyle italicStyle         = EmphasisStyle.Asterisk,
            BulletListStyle bulletListStyle   = BulletListStyle.Asterisk,
            OrderedListStyle orderedListStyle = OrderedListStyle.Dot,
            HeadingStyle headingStyle         = HeadingStyle.NumberSign,
            HeadingOptions headingOptions     = HeadingOptions.EmptyLineBeforeAndAfter,
            TableOptions tableOptions         = TableOptions.FormatHeader
            | TableOptions.OuterDelimiter
            | TableOptions.Padding
            | TableOptions.EmptyLineBeforeAndAfter,
            CodeFenceStyle codeFenceStyle                   = CodeFenceStyle.Backtick,
            CodeBlockOptions codeBlockOptions               = CodeBlockOptions.EmptyLineBeforeAndAfter,
            CharEntityFormat charEntityFormat               = CharEntityFormat.Hexadecimal,
            HorizontalRuleFormat?horizontalRuleFormat       = null,
            AngleBracketEscapeStyle angleBracketEscapeStyle = AngleBracketEscapeStyle.Backslash)
        {
            BoldStyle        = boldStyle;
            ItalicStyle      = italicStyle;
            BulletListStyle  = bulletListStyle;
            OrderedListStyle = orderedListStyle;
            HeadingStyle     = headingStyle;
            HeadingOptions   = headingOptions;
            TableOptions     = tableOptions;
            CodeFenceStyle   = codeFenceStyle;
            CodeBlockOptions = codeBlockOptions;
            CharEntityFormat = charEntityFormat;

            if (BulletListStyle == BulletListStyle.Asterisk)
            {
                BulletItemStart = "* ";
            }
            else if (BulletListStyle == BulletListStyle.Plus)
            {
                BulletItemStart = "+ ";
            }
            else if (BulletListStyle == BulletListStyle.Minus)
            {
                BulletItemStart = "- ";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(BulletListStyle));
            }

            if (BoldStyle == EmphasisStyle.Asterisk)
            {
                BoldDelimiter = "**";
            }
            else if (BoldStyle == EmphasisStyle.Underscore)
            {
                BoldDelimiter = "__";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(BoldStyle));
            }

            if (ItalicStyle == EmphasisStyle.Asterisk)
            {
                ItalicDelimiter = "*";
            }
            else if (ItalicStyle == EmphasisStyle.Underscore)
            {
                ItalicDelimiter = "_";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(ItalicStyle));
            }

            if (OrderedListStyle == OrderedListStyle.Dot)
            {
                OrderedItemStart = ". ";
            }
            else if (OrderedListStyle == OrderedListStyle.Parenthesis)
            {
                OrderedItemStart = ") ";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(OrderedListStyle));
            }

            if (HeadingStyle == HeadingStyle.NumberSign)
            {
                HeadingStart = "#";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(HeadingStyle));
            }

            if (CodeFenceStyle == CodeFenceStyle.Backtick)
            {
                CodeFence = "```";
            }
            else if (CodeFenceStyle == CodeFenceStyle.Tilde)
            {
                CodeFence = "~~~";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(CodeFenceStyle));
            }

            if (horizontalRuleFormat != null)
            {
                Error.ThrowOnInvalidHorizontalRuleFormat(horizontalRuleFormat.Value);

                HorizontalRuleFormat = horizontalRuleFormat.Value;
            }
            else
            {
                HorizontalRuleFormat = HorizontalRuleFormat.Default;
            }

            if (HorizontalRuleStyle == HorizontalRuleStyle.Hyphen)
            {
                HorizontalRuleText = "-";
            }
            else if (HorizontalRuleStyle == HorizontalRuleStyle.Underscore)
            {
                HorizontalRuleText = "_";
            }
            else if (HorizontalRuleStyle == HorizontalRuleStyle.Asterisk)
            {
                HorizontalRuleText = "*";
            }
            else
            {
                throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(HorizontalRuleStyle));
            }

            AngleBracketEscapeStyle = angleBracketEscapeStyle;
        }
public static System.Web.WebPages.HelperResult BeginMessage(EmphasisStyle messageType, IHtmlString heading) {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 131 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                                                                      

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "      <div class=\"panel ");



#line 132 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
WebViewPage.WriteTo(@__razor_helper_writer, string.Format("panel-{0}", messageType.ToString().ToLower()));

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "\">\r\n");



#line 133 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
            if (!string.IsNullOrEmpty(heading.ToHtmlString()))
            {

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "          <div class=\"panel-heading\"><h4 class=\"panel-title\">");



#line 135 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                    WebViewPage.WriteTo(@__razor_helper_writer, heading);

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "</h4></div>\r\n");



#line 136 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
            }

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "          <div class=\"panel-body\">\r\n");



#line 138 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"

#line default
#line hidden

});

}
コード例 #6
0
        public static void MarkdownFormat_Constructor_ItalicStyle(EmphasisStyle italicStyle)
        {
            var format = new MarkdownFormat(italicStyle: italicStyle);

            Assert.Equal(italicStyle, format.ItalicStyle);
        }
コード例 #7
0
 /// <summary>
 /// Adds the given emphasis to the button.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithStyle(EmphasisStyle.Warning)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="style">The style of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
 {
     attrs.AddClass($"btn-{style.ToString().ToLower()}");
     return(attrs);
 }
コード例 #8
0
        public static void MarkdownFormat_Constructor_BoldStyle(EmphasisStyle boldStyle)
        {
            var format = new MarkdownFormat(boldStyle: boldStyle);

            Assert.Equal(boldStyle, format.BoldStyle);
        }
コード例 #9
0
 /// <summary>
 /// Adds the given emphasis to the button.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithStyle(EmphasisStyle.Warning)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="style">The style of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
 {
     attrs.AddClass(string.Format("btn-{0}", style.ToString().ToLower()));
     return(attrs);
 }
コード例 #10
0
 public MarkdownFormat WithBoldStyle(EmphasisStyle boldStyle);
コード例 #11
0
 public MarkdownFormat(EmphasisStyle boldStyle = EmphasisStyle.Asterisk, EmphasisStyle italicStyle = EmphasisStyle.Asterisk, BulletListStyle bulletListStyle = BulletListStyle.Asterisk, OrderedListStyle orderedListStyle = OrderedListStyle.Dot, HeadingStyle headingStyle = HeadingStyle.NumberSign, HeadingOptions headingOptions = HeadingOptions.EmptyLineBeforeAndAfter, TableOptions tableOptions = TableOptions.FormatHeader | TableOptions.Padding | TableOptions.OuterDelimiter | TableOptions.EmptyLineBeforeAndAfter, CodeFenceStyle codeFenceStyle = CodeFenceStyle.Backtick, CodeBlockOptions codeBlockOptions = CodeBlockOptions.EmptyLineBeforeAndAfter, CharEntityFormat charEntityFormat = CharEntityFormat.Hexadecimal, HorizontalRuleFormat?horizontalRuleFormat = null);
コード例 #12
0
 /// <summary>
 /// Adds the given emphasis to the button.
 /// </summary>
 /// <example>
 /// @n.Submit("Submit").WithStyle(EmphasisStyle.Warning)
 /// </example>
 /// <param name="attrs">The Html Attributes from a navigation button</param>
 /// <param name="style">The style of button</param>
 /// <returns>The Html Attribute object so other methods can be chained off of it</returns>
 public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
 {
     attrs.AddClass(string.Format("btn-{0}", style.ToString().ToLower()));
     return attrs;
 }