When I attempt to override it (for a check)...Can you show how you did that?
So that means that the run-time can SEE the method but it cannot be overridden. Correct?Yes.
using System;
namespace ConsoleApplication68
{
class Program
{
static void Main(string[] args)
{
Test.Harness instance1 = new Test.Harness();
Test.Harness instance2 = new Test.Adder();
instance1.deAllocate();
instance2.deAllocate();
Console.ReadKey();
}
}
namespace Test
{
public class Adder : Harness
{
public new bool deAllocate()
{
Console.WriteLine("In Adder.deAllocate");
return true;
}
}
public class Harness : Equipment
{
private int _eid;
public int eid { get { return _eid; } set { _eid = 1; } }
public virtual int Allocate()
{
return 1;
}
public virtual bool deAllocate()
{
Console.WriteLine("In Harness.deAllocate");
// Update database
Audit();
return true;
}
private void Audit()
{
// Update database
}
}
interface Equipment
{
int eid { get; set; }
int Allocate();
bool deAllocate();
}
}
}