By "ease of use" I guess you mean within Intellisense? There's a trick you can use for organising properties within a class so they appear to be in nested classes. You define nested interfaces for each organisational class, and explicity implement those interfaces on the containing class. Then add properties which return the instance cast to the interface.
Like this:
c# code: public class AffiliateConstants : AffiliateConstants.IFilters
{
public IFilters Filters
{
get { return (IFilters)this; }
}
public interface IFilters
{
string FileFilter { get; }
}
#region IFilters Members
private string m_FileFilter;
string IFilters.FileFilter
{
get { return m_FileFilter; }
}
#endregion
}
Then you can only access the FileFilter property through the Filters property:
c# code: AffiliateConstants ac = new AffiliateConstants();
Console.WriteLine(ac.Filters.FileFilter);
|