Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Need to remove #region from whole website

Need to remove #region from whole website

Scheduled Pinned Locked Moved The Lounge
csharpvisual-studiohelpquestion
16 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thats Aragon
    wrote on last edited by
    #1

    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 :)

    R Y L M 4 Replies Last reply
    0
    • T Thats Aragon

      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 :)

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      Find and Replace, with "" as the Replace argument ought to do it.

      Will Rogers never met me.

      1 Reply Last reply
      0
      • T Thats Aragon

        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 :)

        Y Offline
        Y Offline
        Yusuf
        wrote on last edited by
        #3

        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?

        T OriginalGriffO 2 Replies Last reply
        0
        • Y Yusuf

          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?

          T Offline
          T Offline
          Thats Aragon
          wrote on last edited by
          #4

          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 :)

          M L 2 Replies Last reply
          0
          • Y Yusuf

            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?

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            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.

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            Y 1 Reply Last reply
            0
            • T Thats Aragon

              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 :)

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              This still begs the question - Why?

              Never underestimate the power of human stupidity RAH

              B 1 Reply Last reply
              0
              • T Thats Aragon

                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 :)

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                That's Aragon wrote:

                Any help or tips/tricks would be appreciated.

                That's extra work, and we can accommodate your wish at a hourly rate of ten dollar.

                I are Troll :suss:

                1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  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.

                  Y Offline
                  Y Offline
                  Yusuf
                  wrote on last edited by
                  #8

                  Good point. What was I thinking? :-O

                  Yusuf May I help you?

                  1 Reply Last reply
                  0
                  • T Thats Aragon

                    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 :)

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Great tip on using RegEx in Find/Replace. Thanks :)

                    It’s not because things are difficult that we do not dare, it’s because we do not dare that things are difficult. ~Seneca

                    1 Reply Last reply
                    0
                    • T Thats Aragon

                      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 :)

                      M Offline
                      M Offline
                      Marc Clifton
                      wrote on last edited by
                      #10

                      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

                      OriginalGriffO 1 Reply Last reply
                      0
                      • M Mycroft Holmes

                        This still begs the question - Why?

                        Never underestimate the power of human stupidity RAH

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #11

                        That is not begging the question but raising it. Begging the question: http://en.wikipedia.org/wiki/Begging_the_question[^]

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          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

                          OriginalGriffO Offline
                          OriginalGriffO Offline
                          OriginalGriff
                          wrote on last edited by
                          #12

                          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.

                          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                          M 1 Reply Last reply
                          0
                          • OriginalGriffO OriginalGriff

                            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.

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #13

                            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

                            H 1 Reply Last reply
                            0
                            • M Marc Clifton

                              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

                              H Offline
                              H Offline
                              Henry Minute
                              wrote on last edited by
                              #14

                              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.”

                              M 1 Reply Last reply
                              0
                              • H Henry Minute

                                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.”

                                M Offline
                                M Offline
                                Marc Clifton
                                wrote on last edited by
                                #15

                                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

                                D 1 Reply Last reply
                                0
                                • M Marc Clifton

                                  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

                                  D Offline
                                  D Offline
                                  Dan Neely
                                  wrote on last edited by
                                  #16

                                  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

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups