简体   繁体   中英

Creating a single file from many classes(files) under one namespace in Visual Studio 2013

I need a shortcut to be able to create a single file(any text file or cs file in C#) from all the classes in a single project. They happen to be under the same namespace. Is it possible with Visual Studio 2013 and maybe with ReSharper? Thanks.

For example a project composed of:

BaseClass.cs, DerivedClass.cs, IExampleInterface.cs, ProgramMain.cs

together grouped into

Program.cs or some text file.

I think that's what you are after? or am I wrong? But I am faling to underwstand one thing, if they are under the same project , why would you want to place everything under the same file?

namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        public class BaseClass
        {
        }

        public class DerivedClass : BaseClass
        {
        }

        interface IExampleInterface
        {
        }

        public class ProgramMain
        {
        }
    }
}

一种方法是使用CSFilesUnifier,但最好使用VS2013。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM