Why am I getting this error when overriding an inherited method?
Posted
by Sergio Tapia
on Stack Overflow
See other posts from Stack Overflow
or by Sergio Tapia
Published on 2010-02-05T01:28:20Z
Indexed on
2010/05/12
22:34 UTC
Read the original article
Hit count: 244
c#
|inheritance
Here's my parent class:
public abstract class BaseFile
{
public string Name { get; set; }
public string FileType { get; set; }
public long Size { get; set; }
public DateTime CreationDate { get; set; }
public DateTime ModificationDate { get; set; }
public abstract void GetFileInformation();
public abstract void GetThumbnail();
}
And here's the class that's inheriting it:
public class Picture:BaseFile
{
public override void GetFileInformation(string filePath)
{
FileInfo fileInformation = new FileInfo(filePath);
if (fileInformation.Exists)
{
Name = fileInformation.Name;
FileType = fileInformation.Extension;
Size = fileInformation.Length;
CreationDate = fileInformation.CreationTime;
ModificationDate = fileInformation.LastWriteTime;
}
}
public override void GetThumbnail()
{
}
}
I thought when a method was overridden, I could do what I wanted with it. Any help please? :)
© Stack Overflow or respective owner