Sunday, August 27, 2006

The TOCElement Class

This class is one of several classes that I use in the revised document management interface.  I am including them as separate entries so that you can have multiple web pages up at the same time.  The revised interface and the commentary on the interface will be posted shortly.  By the way, I am posting this entry using the beta version of Live Writer using the Live Writer plug-in for code formatting written by Steve Dunn.  Works quite nicely.

Another class suitable for subclassing.

namespace Interfaces
{
/// <summary>
/// The TOCElement holds the data
/// for a single table of contents entry.
/// This includes the corresponding document index,
/// the title of the TOC entry, and the depth of the
/// TOC entry. The "root" entry is at level zero; no
/// other TOC entry can be at level zero. The Chapters
/// are at level 1, the sections are at level 2,
/// and the subsections are at level 3. Note that the
/// class is immutable; no changes can be made once the
/// class is instantiated.
/// </summary>
public class TOCElement
{
DocumentIndex _DocumentIndex;
string _Title;
int _Level;

public TOCElement(DocumentIndex docIndex,
string title, int level)
{
_DocumentIndex
= docIndex;
_Title
= title;
_Level
= level;
}

public DocumentIndex DocumentIndex
{
get {return _DocumentIndex;}
}
public string Title
{
get {return _Title;}
}
public int Level
{
get {return _Level;}
}
}
}

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home