Re: C# Variable Declaration Spec
Brady Kelly <[email protected]> Mon, 23 Apr 2007 10:06:02 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Organization | Chase Software |
| Message-ID | <[email protected]> |
Thanks, I'll give it a try later. > -----Original Message----- > From: Discussion relating to the specifics of the C# and Managed C++ > languages [mailto:[email protected]] On Behalf Of Davy J > Sent: 23 April 2007 09:59 AM > To: [email protected] > Subject: Re: [DOTNET-CX] C# Variable Declaration Spec > > This should help, it's a 2005 macro, can't remember if you can do the > same thing in 2003. > > Dave, > > Private Function GetCodeElement(Optional ByVal findInnerBrace As > Boolean = False, Optional ByVal ClassOnly As Boolean = False) As > CodeElement > > Dim sel As TextSelection = DTE.ActiveWindow.Selection > If findInnerBrace Then > sel.FindText("{") 'find the next open bracket > End If > > Dim code As CodeElement > If ClassOnly Then > Return > sel.ActivePoint.CodeElement(vsCMElement.vsCMElementClass) > End If > > code = > sel.ActivePoint.CodeElement(vsCMElement.vsCMElementFunction) > If code Is Nothing Then > code = > sel.ActivePoint.CodeElement(vsCMElement.vsCMElementAttribute) > End If > If code Is Nothing Then > code = > sel.ActivePoint.CodeElement(vsCMElement.vsCMElementProperty) > End If > If code Is Nothing Then > code = > sel.ActivePoint.CodeElement(vsCMElement.vsCMElementClass) > End If > Return code > End Function > > On 4/22/07, Brady Kelly <[email protected]> wrote: > > My first step is to extract the variable names from the > > text block, > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com