You have the wrong syntax for invoking an overloaded constructor from the default constructor.
To invoke an overloaded constructor in the same class, use this syntax:
public ClassName(parameters) : this(otherParameters)
{
}
If you want to call the constructor in the base class, you should use the keyword baseinstead this. In your case, the code will read:
public SaveFile() : this(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SaveFile.DAT") {}
public SaveFile(string location)
{
this.Save(location);
}
source
share