R
roland
This is what I want to achieve:
A control is exposing different methods in design mode, according to the
presence of a license.
For instance: when an instance is created of the control (class) and no
license is found, method A is available but method B not.
The license is a class variable, but only resolved at the time the first
instance is being instantiated (new()).
The purpose is to avoid a runtime license. The
SetSavedLicenseKey/GetSavedLicenseKey is using the calling assembly to store
the license key and I don't like (=trust) this solution!
I know you can enforce a different "behaviour" from a class with interfaces:
public class Class1
implements I1,I2
....
end class
public interface I1
....
end interface
public interface I2
....
end interface
When you define an object as I1 and instantiate this object as Class1, you
will only have access to the methods of I1. But I don't see a possibility to
enforce the restriction to expose the methods of one interface from within
the class itself.
Can anybody pointing me towards a solution (not necessarely with
interfaces!) ?
Thanks in advance,
Roland
A control is exposing different methods in design mode, according to the
presence of a license.
For instance: when an instance is created of the control (class) and no
license is found, method A is available but method B not.
The license is a class variable, but only resolved at the time the first
instance is being instantiated (new()).
The purpose is to avoid a runtime license. The
SetSavedLicenseKey/GetSavedLicenseKey is using the calling assembly to store
the license key and I don't like (=trust) this solution!
I know you can enforce a different "behaviour" from a class with interfaces:
public class Class1
implements I1,I2
....
end class
public interface I1
....
end interface
public interface I2
....
end interface
When you define an object as I1 and instantiate this object as Class1, you
will only have access to the methods of I1. But I don't see a possibility to
enforce the restriction to expose the methods of one interface from within
the class itself.
Can anybody pointing me towards a solution (not necessarely with
interfaces!) ?
Thanks in advance,
Roland