예제 #1
0
        protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress)
        {
            IHtmlTagHeader tagHeader = GetTag();

            if (tagHeader == null)
            {
                return(null);
            }

            // The easiest way to create an attribute is to create an HTML tag with an attribute in it
            // and then get the attribute from the tag.
            HtmlElementFactory factory = HtmlElementFactory.GetInstance(tagHeader.Language);
            IHtmlTag           dummy   = factory.CreateHtmlTag("<tag id=\"\"/>", tagHeader);
            ITagAttribute      idAttr  = dummy.Attributes.Single();

            tagHeader.AddAttributeBefore(idAttr, null);

            // continuation to do after transaction committed
            return(textControl =>
                   // move cursor inside new created id attribute
                   textControl.Caret.MoveTo(idAttr.ValueElement.GetDocumentRange().TextRange.StartOffset, CaretVisualPlacement.Generic));
        }
예제 #2
0
 public IType GetType(IHtmlTag treeTag)
 {
     // This is used by asp.net, to map tags to controls, I think
     return(TypeFactory.CreateUnknownType(treeTag));
 }
 public ParameterValueAttributeSetter(IHtmlTag tag)
 {
     _tag        = tag;
     _attributes = new List <ParameterValue>();
 }
예제 #4
0
 public HtmlRenderer(TextWriter textWriter)
 {
     this.textWriter = textWriter;
     htmlTag = new HtmlTag();
 }
 public IType GetType(IHtmlTag treeTag)
 {
     // This is used by asp.net, to map tags to controls, I think
     return TypeFactory.CreateUnknownType(treeTag);
 }
예제 #6
0
파일: HtmlTag.cs 프로젝트: UStack/UWeb
 public HtmlTag AddChild(IHtmlTag child)
 {
     children.Add(child);
     return this;
 }
 public IType GetType(IHtmlTag treeTag)
 {
     // This is used by asp.net, to map tags to controls, I think
     return TypeFactory.CreateUnknownType(treeTag.GetPsiModule(), treeTag.GetResolveContext());
 }