Y
Ympostor
I have an abstract class with a bool property:
class Abstract {
protected bool throwException;
protected void ThrowException{
if (this.throwException){
throw new MyException();
}
}
}
I then have two derived classes that have propertys:
class A : Abstract {
property X {
get { ... }
set { ... }
}
property Y {
get { ... }
set { ... }
}
}
class B : Abstract {
property Z {
get { ... }
set { ... }
}
}
How can I implement an scenario where the objects from class A or from
class B invoke the abstract method ThrowException every time a property
is accessed I mean, inserting the call as the first instruction of the
get/set methods, without having to coding it, just inserting the call at
runtime (modifying the accessors at runtime)?
Thanks in advance.
--
class Abstract {
protected bool throwException;
protected void ThrowException{
if (this.throwException){
throw new MyException();
}
}
}
I then have two derived classes that have propertys:
class A : Abstract {
property X {
get { ... }
set { ... }
}
property Y {
get { ... }
set { ... }
}
}
class B : Abstract {
property Z {
get { ... }
set { ... }
}
}
How can I implement an scenario where the objects from class A or from
class B invoke the abstract method ThrowException every time a property
is accessed I mean, inserting the call as the first instruction of the
get/set methods, without having to coding it, just inserting the call at
runtime (modifying the accessors at runtime)?
Thanks in advance.
--