internal void Validate()
{
if (_status == InitStatus.Valid) {
return;
}
Init();
// reset status to avoid status check in properties from getting
// triggered
_status = InitStatus.Initialized;
try {
// verify if framework directory is configured, and indirectly
// check if it exists
if (FrameworkDirectory == null) {
throw new ArgumentException("The \"frameworkdirectory\" " +
"attribute does not exist, or has no value.");
}
// verify if framework assembly directory is configured, and
// indirectly check if it exists
if (FrameworkAssemblyDirectory == null) {
throw new ArgumentException("The \"frameworkassemblydirectory\" " +
"attribute does not exist, or has no value.");
}
// verify if version is configured
if (Version == null) {
throw new ArgumentException("The \"version\" attribute " +
"does not exist, or has no value.");
}
// verify if clrversion is configured
if (ClrVersion == null) {
throw new ArgumentException("The \"clrversion\" attribute " +
"does not exist, or has no value.");
}
// mark framework valid
_status = InitStatus.Valid;
} catch (Exception ex) {
_status = InitStatus.Invalid;
throw new BuildException(string.Format(CultureInfo.InvariantCulture,
"{0} ({1}) is not installed, or not correctly configured.",
Description, Name), Location.UnknownLocation, ex);
}
}