Sunday, December 20, 2015

Code Refactors: Underscore Fields

Its feature is pretty self-explanatory, underscoring class fields.

If something like the following is written somewhere,

class CodeTester_Fields { protected int intField; int intFieldWithValue = 123; public readonly int intFieldReadonlyWithValue = 456; public const int intFieldConst = 789; new int intFieldNew; private double doubleFieldWithValue = 123.456; public double doubleField; public static string stringFieldWithValue = "string field with value"; static string stringField; }

        all the fields selected, and the Underscore Fields command is called up, the class fields will become the following:

class CodeTester_Fields
        protected int _intField;
        int _intFieldWithValue = 123;
        public readonly int _intFieldReadonlyWithValue = 456;
        public const int _intFieldConst = 789;
        new int _intFieldNew;

        private double _doubleFieldWithValue = 123.456;
        public double _doubleField;

        public static string _stringFieldWithValue = "string field with value";
        static string _stringField;


FREE Download and Try Visual Smarter 2015

No comments:

Post a Comment