Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / July 2004

Tip: Looking for answers? Try searching our database.

DTE Object Reference to Text in Code WIndow ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith at QES - 10 Jul 2004 00:21 GMT
I am trying to write a VB.Net 2003 addin which will find the start and end
of the procedure in which the cursor is located and insert a block of code
right after the procedure header and another right before the end of the
procedure. I have tried to navigate the DTE object model with no success
visited websites and newsgroups and examined samples. but I still don't seem
to be able to figure this out..  Can anyone help me here?
Carlos J. Quintero [MVP] - 12 Jul 2004 10:18 GMT
3 steps:

1) Get the current procedure code element. You can use
EditPoint.CodeElement(vsCMElement.vsCMElementFunction). Notice that this
function is buggy. See

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&frame=right&th=74f52
6821382f1b9&seekm=ef1Kg3zXEHA.3716%40TK2MSFTNGP11.phx.gbl#link4


2) Once you have the CodeElement, you have CodeElement.GetStartPoint(part)
and CodeElement.GetEndPoint(part) where you pass the requested part and you
get an EditPoint. These functions have also their dosis of bugs...

3) With a TextPoint, you call TextPoint.CreateEditPoint to get an EditPoint,
and then you call EditPoint.Insert(blah blah).

Signature

Carlos J. Quintero (Visual Developer - .NET MVP)

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)

> I am trying to write a VB.Net 2003 addin which will find the start and end
> of the procedure in which the cursor is located and insert a block of code
> right after the procedure header and another right before the end of the
> procedure. I have tried to navigate the DTE object model with no success
> visited websites and newsgroups and examined samples. but I still don't seem
> to be able to figure this out..  Can anyone help me here?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.