TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
Dynamically accessing methods of a derived class using base class object
Mar 31 2003 3:56 AM
Hi, I need to access derived class methods/properties using base class object. Implementation goes like this, public interface IBaseComponent { object Properties { get; } } public class BaseComponent : IBaseComponent { public object Properties { get { // Some code to return derived // class Properties } } } public class DerivedComponent : BaseComponent { string Name { get { return "Success"; } } } static void main() { BaseComponent baseobj = new DerivedComponent(); string a = (string)baseobj.Properties.Name; // a should contain string "Success" } ************************************* Any help in this regard will be appreciated. Thanks, Usman
Reply
Answers (
0
)
Appending XML
Unmanaged client / Async delegates /RemotingException