0
Answer

RoutedEvent Header Macro

Ask a question
jon

jon

16y
1.7k
1

I was able to create macros for functions, classes, and etc, but RoutedEvent is giving me trouble.  For example my class header macro read as..

Public Sub CreateClassHeader()

Dim caretPosition As TextPoint = DTE.ActiveDocument.Selection.ActivePoint()

Dim element As CodeElement = caretPosition.CodeElement(vsCMElement.vsCMElementClass)

If Not element Is Nothing Then

Dim doc As XmlDocument = New XmlDocument

Dim xmlStr As String = "<doc></doc>"

Dim rootTag = doc.CreateElement("doc")

doc.AppendChild(rootTag)

If doc.SelectSingleNode("/doc/Class") Is Nothing Then

HeaderBegin(doc)

' Class name

Dim nameTag As XmlElement = doc.CreateElement("Class")

nameTag.SetAttribute("Class_Name", "")

nameTag.AppendChild(doc.CreateTextNode(element.Name))

doc.FirstChild.AppendChild(nameTag)

' Description

ClassDescriptiontag(doc)

HeaderEnd(doc)

SetCommentXml(element, doc)

End If

Else

MsgBox("Selection Not Found! Place cursor at the beginning of the class declaration.")

End If

Exit Sub

End Sub

 

But I can't seem to figure out how to create a header macro for something like..  

public static readonly RoutedEvent AcceptRequiredChangedEvent;

any help would be appreciated, thanks