How to declare properties across inherited interfaces.

D

DaTurk

Is it possible to have a property defined in one interface, with just
the get portioned stubbed out, and then in an interface inheriting from
that interface declare the set portion of the inherited stubbed out
property? So that only classes implementing the second interface can
set properties?
 
A

Adam Clauss

Nicholas Paldino said:
DaTurk,

Unfortunately it is not possible.

Wow, interesting. I'll be honest - when I first read your post I thought
"there is no way that's not possible." So I went and tried it, and sure
enough you can't do it.

Why would this not be allowed?
 
D

DaTurk

I am able to do it using managed C++. I thought it was an interface
problem, but it was a casting problem. I have another post that
outlined what I did, because I was trying to figure out what was going
wrong, but sure enough I have the get portion in the parent interface,
and the set portion in the child interface and then implement them and
then cast the class instance to the child interface and I can set the
properties. All of the code is in C#, except the interface which are
in MCPP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top