Hello,
I would like to know if it is possible to inforce specific members
implementation just as methods inforcment of methods implementaion in
Interface?
Thank u!
Michael Nemtsev [MVP] - 03 Jan 2008 09:21 GMT
Hello csharpula,
not quite understood what u want.
Force specific method from interface to be impemented?
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
cc> Hello,
cc> I would like to know if it is possible to inforce specific members
cc> implementation just as methods inforcment of methods implementaion
cc> in
cc> Interface?
cc> Thank u!
cc> *** Sent via Developersdex http://www.developersdex.com ***
cc>
Jon Skeet [C# MVP] - 03 Jan 2008 09:47 GMT
> I would like to know if it is possible to inforce specific members
> implementation just as methods inforcment of methods implementaion in
> Interface?
Methods *are* members (as are properties and events, which can also be
part of interfaces). Do you mean enforcing fields? If so, there isn't a
way of doing it - and a good thing too, as it's generally a bad idea to
make fields non-private anyway.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Barry Kelly - 03 Jan 2008 15:00 GMT
> Hello,
> I would like to know if it is possible to inforce specific members
> implementation just as methods inforcment of methods implementaion in
> Interface?
You can require implementation of properties:
interface IMyIntf
{
int MyProp { get; set; }
}
-- Barry

Signature
http://barrkel.blogspot.com/
Ignacio Machin ( .NET/ C# MVP ) - 03 Jan 2008 15:57 GMT
Hi,
As the other said it's not clear what you want.
You could make your class abstract and thus force the implementation of
members in a derived class.
If this is not what you want, just post back with more details

Signature
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
>
> Hello,
[quoted text clipped - 4 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***