Ejemplo n.º 1
0
        private static Snippet CreateCDataSnippetSnippet()
        {
            var s = new Snippet()
            {
                Title    = "CDATA section",
                Shortcut = "cdata"
            };

            s.Description = s.Title;

            s.AddLiteral(new Literal(CDataIdentifier)
            {
                DefaultValue = "]]>", IsEditable = false
            });

            s.AddLiteral(CreateContentLiteral());

            var b = new SnippetCodeBuilder();

            b.Append("<![CDATA[");
            b.AppendPlaceholder(ContentIdentifier);
            b.AppendPlaceholder(CDataIdentifier);
            s.CodeText = b.ToString();

            s.FilePath = "CDataSection";

            return(s);
        }
Ejemplo n.º 2
0
        private static Snippet CreateSelfClosingElementSnippet()
        {
            var s = new Snippet()
            {
                Title    = "self-closing element",
                Shortcut = ElementShortcut
            };

            s.Description = s.Title;

            s.AddLiteral(CreateElementNameLiteral());

            var b = new SnippetCodeBuilder();

            b.Append("<");
            b.AppendPlaceholder(ElementNameIdentifier);
            b.AppendPlaceholder(AttributeIdentifier);
            b.Append(" />");
            b.AppendEndPlaceholder();
            s.CodeText = b.ToString();

            s.FilePath = "SelfClosingElement";

            return(s);
        }
Ejemplo n.º 3
0
        private static Snippet CreateCommentSnippet()
        {
            var s = new Snippet()
            {
                Title    = "comment",
                Shortcut = CommentShortcut
            };

            s.Description = s.Title;

            s.AddLiteral(CreateCommentLiteral());

            var b = new SnippetCodeBuilder();

            b.Append("<!-- ");
            b.AppendPlaceholder(Placeholder.SelectedIdentifier);
            b.AppendPlaceholder(CommentIdentifier);
            b.Append(" -->");
            s.CodeText = b.ToString();

            s.FilePath = "Comment";

            return(s);
        }