Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9290261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:22:39+00:00 2026-06-18T20:22:39+00:00

Due to the disappointing fact of having public as default modificator for classes /

  • 0

Due to the disappointing fact of having public as default modificator for classes/structs/enums in both Visual Studio and Resharper, the solution I am working on right now has a huge amount of public classes which are not used outside a library they are defined in. So I want to make all those classes internal. And I don’t want to do it manually.

Is there any way to automate this task? In general I want to have something like Adjust visibility refactoring (similar to Resharper’s Adjust namespaces).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T20:22:40+00:00Added an answer on June 18, 2026 at 8:22 pm

    You can find-and-replace using regular expressions. For example in Visual Studio 2012, the following will do what you want (after you enable regular expression matching in the search box):

    public (.*(class|enum|struct))
    

    Replace with:

    internal $1
    

    After that you can use the class view to show only public members and do those that are left manually.


    For Visual Studio 2010 the syntax is different. I think it is like this, but could not test it:

    public {:.*(class|enum|struct)}
    

    Replace with:

    internal \1
    

    You can find more information here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Due to my inability to properly design my classes I reached a point where
Due to a reverse proxy setup I'm having to pass an extra query var
due to changes to the data model, the serialized xml of my classes are
Due to the fact that my setups keeps growing I'd like to use some
Due to lack of capital and time we are having to do our game
Due to a sad situation I receive HTML like this: <p>Perform the following commands:
Due to legacy reasons a lot of our data is stored encoded in standard
Due to an incident a few months prior, thousands of author_ids have been deleted
Due to a bug in my javascript click handling, multiple Location objects are posted
Due to some css limitations between IE and the rest of the world I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.