Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Interface vs memebers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
csharpula csharp - 03 Jan 2008 09:08 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?
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 ***

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.