Sunday, August 27, 2006

The DocumentIndex 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 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.

The document index class as shown below is a wrapper around a single string.  Looked at from the point of view of reducing the number of lines of code, this looks a bit silly.  Looked at from the point of view of expressing the intent unambiguously, it is not so silly, especially when a document comes along that needs more than a simple string.

namespace Interfaces
{
/// <summary>
/// This class holds the reference to a particular portion
/// of the document.
/// </summary>
/// <remarks>
/// The intent of this class is that it can be used
/// as is for documents that can use a single string as a pointer
/// into the document or as a base class for a derived child
/// class that may use a more compilicated document indexing
/// scheme. Also, the intent is that a given
/// DocumentIndex instance be immutable once it is
/// instantiated.
/// </remarks>
public class DocumentIndex
{

private string _Index;

public DocumentIndex(string index)
{
_Index
= index;
}

public string Index
{
get {return _Index;}
}
}
}

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home