Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When you create classes with a lot of members of one type or another, things can get quite confusing, and code files can get very long. One thing that can help here, that you've looked at in earlier chapters, is to use code outlining. By defining regions in code, you can collapse and expand sections to make things easier to read. For example, you might have a class defined as follows:
public class MyClass
{
#region Fields
private int myInt;
#endregion
#region Constructor
public MyClass()
{
myInt = 99;
}
#endregion
#region Properties
public int MyInt
{
get
{
return myInt;
}
set
{
myInt = value;
}
}
#endregion
#region Methods
public void DoSomething()
{
// Do something...
}
#endregion
}