473,666 Members | 2,116 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 1446
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******** ******@TK2MSFTN GP09.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 MyCompaniesMeth ods;
#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.Activ eWindow.Selecti on,
TextSelection)
Dim start As EditPoint = ts.TopPoint.Cre ateEditPoint()
Dim endpt As TextPoint = ts.BottomPoint
Dim sb As New StringBuilder

Try
Dim sRegionName As String =
start.GetText(s tart.LineLength ).Trim
start.Delete(st art.LineLength)
start.Insert("# Region """ & sRegionName & """" & vbCrLf)
Do While (start.LessThan (endpt))
start.LineDown( )
start.StartOfLi ne()
Loop
start.Insert("# End Region" & vbCrLf)

Catch ex As System.Exceptio n
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
2073
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. I've done this using the method I found in MSDN, as shown in the code below. The problem is that we believe doing it this way involves the use of the Microsoft Transaction Server (IIS transaction server). Is this true? (The SQL Server and IIS...
3
4012
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 found some things that I don't understand so if any one could shed any light it would be much appreciated. I have posted these at the end.
17
3846
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 "table" insert in my "editable region", have it placed in the "center" of the page.. while it display correctly on my browser, with setting at 1024x768 (IE6),
1
2902
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 text boxes? What this script is suppose to do is change the value of a second drop down list based on the selection from the first. Then a value is chosen from the script generated drop down list in 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 update i exatly know that only one row will be updated , is necessary or when i need to wrap it with transaction ------------------------------------------------------------------------------
3
1870
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: http://www.dotnetjunkies.com/Tutorial/0C968B48-44E8-4637-9F19-8490B0429881.dcik which explains how this can be done but does not supply enough example code my newbie self to go through in detail where I understand it. So, does anyone have some example code I could use to accomplish this or know...
3
1377
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 reocrds with ColumnA = 'Value A', an other time all the reords with ColumnB = 'An other value', a third time all records with "ColumnA = 'Value C' AND ColumnB = 'this value'" etc etc.
3
3666
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 html is: <a class="searchsavechanges btn btn3d tbbtn" href="javascript:" style="position:static"> <div id="TBsearchsavechanges">Search</div> </a>
2
4100
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
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
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 we have to send another system
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.