Need to remove #region from whole website
-
Hi All, I need to deliver source code to client and my boss need to remove all the #region sections from the whole web site source code!!!!!. :confused: So is there any functionality available in visual studio 2010 or may be other 3rd party tool available to do so, which can remove all the #region from all over the source code ? Otherwise my developers has to do donkey work.... :(( and I don't wish it. Any help or tips/tricks would be appreciated. Thanks
Regards :)
Find and Replace, with "" as the Replace argument ought to do it.
Will Rogers never met me.
-
Hi All, I need to deliver source code to client and my boss need to remove all the #region sections from the whole web site source code!!!!!. :confused: So is there any functionality available in visual studio 2010 or may be other 3rd party tool available to do so, which can remove all the #region from all over the source code ? Otherwise my developers has to do donkey work.... :(( and I don't wish it. Any help or tips/tricks would be appreciated. Thanks
Regards :)
The first thought that crossed my mind was, why? why remove #region from the source code? But then we all have seem more stranger request/command/order blipping out the pointy hair mouse. How about writing a regular expression to find and remove all #region and #endregion along with any preceding/succeeding comments. I guess that may not be that hard. :^)
Yusuf May I help you?
-
The first thought that crossed my mind was, why? why remove #region from the source code? But then we all have seem more stranger request/command/order blipping out the pointy hair mouse. How about writing a regular expression to find and remove all #region and #endregion along with any preceding/succeeding comments. I guess that may not be that hard. :^)
Yusuf May I help you?
Hey Roger and Yusuf, Thanks for the reply. I have tried with the solution provided here and it works just perfect for me. Appreciate your help. Thanks
Regards :)
-
The first thought that crossed my mind was, why? why remove #region from the source code? But then we all have seem more stranger request/command/order blipping out the pointy hair mouse. How about writing a regular expression to find and remove all #region and #endregion along with any preceding/succeeding comments. I guess that may not be that hard. :^)
Yusuf May I help you?
Um - succeeding comments to a #region are likely to be method XML documentation...
#region Private Methods /// <summary> /// Extract the text within double quotes only. /// </summary> /// <param name="p">String to process /// <returns>Content originally within double quotes, or whole string if no matched double quotes.</returns> private static string GetText(string p) { Match m = matchDQuotes.Match(p); if (m.Success) { return m.Groups\[1\].Value; } return p; }
...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
-
Hey Roger and Yusuf, Thanks for the reply. I have tried with the solution provided here and it works just perfect for me. Appreciate your help. Thanks
Regards :)
This still begs the question - Why?
Never underestimate the power of human stupidity RAH
-
Hi All, I need to deliver source code to client and my boss need to remove all the #region sections from the whole web site source code!!!!!. :confused: So is there any functionality available in visual studio 2010 or may be other 3rd party tool available to do so, which can remove all the #region from all over the source code ? Otherwise my developers has to do donkey work.... :(( and I don't wish it. Any help or tips/tricks would be appreciated. Thanks
Regards :)
-
Um - succeeding comments to a #region are likely to be method XML documentation...
#region Private Methods /// <summary> /// Extract the text within double quotes only. /// </summary> /// <param name="p">String to process /// <returns>Content originally within double quotes, or whole string if no matched double quotes.</returns> private static string GetText(string p) { Match m = matchDQuotes.Match(p); if (m.Success) { return m.Groups\[1\].Value; } return p; }
...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Good point. What was I thinking? :-O
Yusuf May I help you?
-
Hey Roger and Yusuf, Thanks for the reply. I have tried with the solution provided here and it works just perfect for me. Appreciate your help. Thanks
Regards :)
-
Hi All, I need to deliver source code to client and my boss need to remove all the #region sections from the whole web site source code!!!!!. :confused: So is there any functionality available in visual studio 2010 or may be other 3rd party tool available to do so, which can remove all the #region from all over the source code ? Otherwise my developers has to do donkey work.... :(( and I don't wish it. Any help or tips/tricks would be appreciated. Thanks
Regards :)
I hate regions. Why? Because the idiots at Microsoft who implemented "Find" don't search inside closed regions. WTF were they thinking? Didn't they fix this in VS2010, or make it an option at least, an option I never remember to enable because I can't think of what reason I would NOT want to search in a region??? Marc
-
This still begs the question - Why?
Never underestimate the power of human stupidity RAH
That is not begging the question but raising it. Begging the question: http://en.wikipedia.org/wiki/Begging_the_question[^]
-
I hate regions. Why? Because the idiots at Microsoft who implemented "Find" don't search inside closed regions. WTF were they thinking? Didn't they fix this in VS2010, or make it an option at least, an option I never remember to enable because I can't think of what reason I would NOT want to search in a region??? Marc
Works fine for me in VS2008 - Right click...Outlining...Collapse to definitions. CTRL-Home CTRL-F "Unknown" ENTER expands regions as needed to show the finds. What are you doing that is different?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
-
Works fine for me in VS2008 - Right click...Outlining...Collapse to definitions. CTRL-Home CTRL-F "Unknown" ENTER expands regions as needed to show the finds. What are you doing that is different?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
OriginalGriff wrote:
What are you doing that is different?
I'm not sure. I just remember that yesterday, in fact, I was doing a search, I knew the text existed, but it didn't find any results, then I realized I had collapsed regions. I right-clicked and selected stop outlining, did the search again, and it found what I was looking for. IIRC, there was some fix for VS for that. I may not have it installed. Marc
-
OriginalGriff wrote:
What are you doing that is different?
I'm not sure. I just remember that yesterday, in fact, I was doing a search, I knew the text existed, but it didn't find any results, then I realized I had collapsed regions. I right-clicked and selected stop outlining, did the search again, and it found what I was looking for. IIRC, there was some fix for VS for that. I may not have it installed. Marc
Marc Clifton wrote:
IIRC, there was some fix for VS for that. I may not have it installed.
In the search dialog there is a 'Search Hidden Text' checkbox. Check it - problem solved.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Marc Clifton wrote:
IIRC, there was some fix for VS for that. I may not have it installed.
In the search dialog there is a 'Search Hidden Text' checkbox. Check it - problem solved.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
In the search dialog there is a 'Search Hidden Text' checkbox. Check it - problem solved.
Woohoo. I'd rather just the damn thing searched in closed regions. A closed region is, in my mind, different from "hidden" text. But then again, I don't understand why anyone needs to "hide" the code in a region to begin with! Marc
-
Henry Minute wrote:
In the search dialog there is a 'Search Hidden Text' checkbox. Check it - problem solved.
Woohoo. I'd rather just the damn thing searched in closed regions. A closed region is, in my mind, different from "hidden" text. But then again, I don't understand why anyone needs to "hide" the code in a region to begin with! Marc
It makes finding stuff easier. Reading a list of a half dozen regions, expanding it and reading a list of a half dozen functions takes less time than reading a list of 36 functions. Within a function it can be used to hide chunks of tedium code, eg initializing an array of objects whose properties don't let you use a simple loop to create the whole mess in a few lines of code.
3x12=36 2x12=24 1x12=12 0x12=18