How best to structure class heirachy in C# to enable access to parent class members?
<p>I am having a couple of issues deciding how best to describe a certain data structure in C# (.NET 3.5).</p>

<p>I have to create a class library that creates some text files for the input of a command line program. There are dozens of file types, but most of them have a similar header, footer and a couple of other properties. </p>

<p>So a file might look like this:</p>

<pre><code>timestamp filename company

....lots of attributes that make up the file body....

footerdetail1 footerdetail2 footerdetail3
</code></pre>

<p>Now out of these dozens of file types there are really only three unique header/footer combos. </p>

<p>So I want to make a parent class that contains most of the headerItems and footeritems, and then implement the actual file types in a derived class:</p>

<pre><code>class BaseFileType {

public List&lt;HeaderItems&gt;; 
public List&lt;BodyItems&gt;;   
public List&lt;FooterItems&gt;;
FileType filetype;
String filename;

public BaseFileType1 (FileType filetype,String filename) {

   this.filetype = filetype;
   this.filename = filename;


   // add stuff to the header list
   // add stuff to the footer list


} 

    // some methods to find items in the header/ footer lists

}

class ActualFile1 : BaseFileType {

    ActualFile() {


    //add stuff to the bodyitems list
    }


    //some other generic methods


}
</code></pre>

<p>The thing is, I want to inherit the contructor from the base class for the derived class, but from what I have read this can not be done. What is the best strategy here? </p>

<p>I have seen that I can call the base constructor from my derived class constructor like so:</p>

<p>ActualFile() : base (parent parameters)</p>

<p>Is this even the best way to go about my task?  In the end I am just looking for the best data structures for all of this file information so I dont need to repeat myself when I make these classes. </p>

<p>What other alternatives to people thing would work? Have a single FileFactory that spits out classes containing the structure I require?</p>
