Is there a way to refer to a class (i.e. Type) that inherits an abstract class?
class abstract Monster
{
string Weakness { get; }
string Vice { get; }
Type WhatIAm
{
get { }
}
}
class Vampire : Monster
{
string Weakness { get { return "sunlight"; }
string Vice { get { return "drinks blood"; } }
}
Vampire dracula = new Vampire();
Type t = dracula.WhatIAm;
For those who were interested ... what I'm doing: I want to know when my site was last published. .GetExecutingAssemblyworked fine until i pulled the dll out of my solution. After that, BuildDateit was always the last build date for the DLL utility, not the dll site.
namespace Web.BaseObjects
{
public abstract class Global : HttpApplication
{
public DateTime BuildDate
{
get
{
return File.GetLastWriteTime(
System.Reflection.Assembly.GetAssembly(this.GetType()).Location);
}
}
}
}
source
share