Results 1 to 4 of 4
Thread: Same keyword #region in C#
- 01-27-2012, 04:27 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 27
- Rep Power
- 0
Same keyword #region in C#
In C#, there is a useful keyword named #region. (Maybe this keyword not in C#, it just be defined by IDE Visual Studio).
Purpose of this keyword is lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Editor.
for example:
So, above code is a block and I can collapse it for short view. (like you often do for a function).Java Code:#region this is example //command A //command B #endregion
this way is useful for a long code. But I don't know what keyword same like this in Java (or in Java IDE ? I'm using IDEA and NetBean).
thanks for help :)
- 01-27-2012, 09:39 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Same keyword #region in C#
That's entirely down to the Visual Studio IDE I think.
Eclipse has little '-' and '+' buttons in the left side gutter (as do other Java IDEs) that allow you to compact methods and javadoc comments.
- 01-27-2012, 10:03 AM #3
Member
- Join Date
- Nov 2011
- Posts
- 27
- Rep Power
- 0
Re: Same keyword #region in C#
Yes, but for example. When you use Getter/Setter for a class. It's too long and not necessary to show. And you don't want to click '+' many times. So you just use: (in VS):
And after that, you just press '+' once time. It's faster and less bored. And I don't know how to do the same in Java.Java Code:#region Getter/Setter //code for Getter and Setter here #endregion
- 01-27-2012, 10:21 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
Region and Language problem in Joption
By rjain in forum New To JavaReplies: 0Last Post: 11-04-2011, 11:19 AM -
Replace a region of an image
By alex88 in forum Java 2DReplies: 4Last Post: 06-04-2011, 05:21 PM -
Multiple JButtons in BorderLayout region.
By VisionIncision in forum AWT / SwingReplies: 3Last Post: 01-02-2011, 11:28 PM -
Change color of a region
By sky in forum AWT / SwingReplies: 5Last Post: 11-24-2009, 03:47 PM -
Use of this keyword
By Java Tip in forum Java TipReplies: 0Last Post: 11-18-2007, 07:32 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks