473,508 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tool or script to wrap procedure in a #region?

Greetings,

(Using C# express 2005 beta)

Is there any tool or script that will wrap a procedure in a #region and put
the name of the procedure in the region name?

Thanks!

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Best free software
http://www.vbmark.com
Freeware-dedicated search engine
http://www.eurekster.com/parties/Freeware1.htm
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Nov 17 '05 #1
4 1437
Is that so difficult that you need a tool?

#region My Name
public void SomeMethod()
{
}
#endregion

???

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"vbMark" <no@email.com> wrote in message
news:Xn*******************@199.45.49.11...
Greetings,

(Using C# express 2005 beta)

Is there any tool or script that will wrap a procedure in a #region and put the name of the procedure in the region name?

Thanks!

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Best free software
http://www.vbmark.com
Freeware-dedicated search engine
http://www.eurekster.com/parties/Freeware1.htm
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Nov 17 '05 #2
"Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> wrote in
news:uA**************@TK2MSFTNGP09.phx.gbl:
Is that so difficult that you need a tool?

#region My Name
public void SomeMethod()
{
}
#endregion

???


I have a project that is already begun and has many methods already.

(9 out of 10 people on the Internet are wise guys)

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Best free software
http://www.vbmark.com
Freeware-dedicated search engine
http://www.eurekster.com/parties/Freeware1.htm
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Nov 17 '05 #3
I think you got that remark because you have "vb" in front of your name (ie
..Net is to Vb coders what a package of razor blades is to babies)... But
anyways I would suggest you build a DLL with your companys custom methods
and then add a reference to it. Then add ..

#region Using directives
using System;
using System.Data;
using MyCompaniesMethods;
#endregion

to your code.

That would be the best way to bring in all your procedures.

Denis


"vbMark" <no@email.com> wrote in message
news:Xn*******************@199.45.49.11...
Greetings,

(Using C# express 2005 beta)

Is there any tool or script that will wrap a procedure in a #region and put the name of the procedure in the region name?

Thanks!

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Best free software
http://www.vbmark.com
Freeware-dedicated search engine
http://www.eurekster.com/parties/Freeware1.htm
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Nov 17 '05 #4
Here is a small macro that will wrap a selection of text in a region.
It uses the word on the first line as the name of the region.

So in the code, type the name of the region on a line by itself before
the code you want to encapsulate. Then select that line and all the
code you want encapsulated and run the macro.

For Example:

Region Name
Public Function Foo()
...
End Function

Becomes:

#Region "Region Name"
Public Function Foo()
...
End Function
#End Region

It's not perfect and I'm sure you can find a way to improve it, but at
least it is a starting point.

Public Sub WrapWithRegion()
Dim ts As TextSelection = CType(DTE.ActiveWindow.Selection,
TextSelection)
Dim start As EditPoint = ts.TopPoint.CreateEditPoint()
Dim endpt As TextPoint = ts.BottomPoint
Dim sb As New StringBuilder

Try
Dim sRegionName As String =
start.GetText(start.LineLength).Trim
start.Delete(start.LineLength)
start.Insert("#Region """ & sRegionName & """" & vbCrLf)
Do While (start.LessThan(endpt))
start.LineDown()
start.StartOfLine()
Loop
start.Insert("#End Region" & vbCrLf)

Catch ex As System.Exception
Debug.WriteLine(ex)
End Try
End Sub

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2061
by: Shaun Stuart | last post by:
I've got a webpage that calls some stored procedures with input variables. The procedures return recordsets and also some output variables. We're trying to get the values of the output variables....
3
4003
by: aaj | last post by:
SQL SERVER 2000 Hi all This is my first attempt at writing a stored procedure. I have managed to get it working but its unlikely to be the best way of handling the problem. While writing it I...
17
3836
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a...
1
2882
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
0
421
by: akej via SQLMonster.com | last post by:
Hi to all. Many times i saw that some people wrap the single insert, delete or update statements to transaction. My question is suppose i have procedure , and inside this procedure i perform...
3
1860
by: .Net Newbie | last post by:
I'm new to .Net and need to create a generic (free) way to update lookup tables in SQL Server (using C#) in ASP.Net pages. I found an article at:...
3
1372
by: Pieter | last post by:
Hi, I have a View which contains (of course) several columns. Now I want to make a Stored Procedure that does a Select based on the parameters. For exemple: One time I want to select all the...
3
3647
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
2
4080
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.