My problem is like this. I have a XMLUtility class
public class XmlUtility
{
protected string FilePath;
protected string XMLFileName;
protected XmlDocument SettingsFile;
public XmlUtility(string inFilePath, string inXMLFileName)
{
FilePath = inFilePath;
XMLFileName = inXMLFileName;
if (isFilePresent() == false)
{
createXMLFile();
}
else
{
SettingsFile = new XmlDocument();
SettingsFile.Load(FilePath + "\\" + XMLFileName);
}
}
and a
public bool isFilePresent()
{
return File.Exists(FilePath + "\\" + XMLFileName) ? true : false;
}
and other basic functions such as addSetting, removeSetting, checkSettingExists etc. This class provides functionality for very basic xml settings file.
So now i need a bit more advanced handling of settings. So i created another class and derived it from the XMLUtility class.
public class KeyPairingXML : XmlUtility
{
}
So my initial thought was i don't need to have a constructor for this class as it will call the base classes constructor. But i was wrong.
public KeyPairingXML(string inFilePath, string inXMLFileName) : base(inFilePath, inXMLFileName)
{
}
My question is whether the code above correct? Do i need to write the whole checking process inside this constructor as well or will that be handled by the base class's constructor? Just an empty code block is correct?