Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Still having trouble with Delegates, need help with my example
schmintan
Oct 20 2010 12:23 PM
7k
Reply
Im writing a basic example of delegates usage to help explain it to me. Here is my idea.
User (object) has a playlist of songObjects.
Each songObject contains a song title and the media the song is on (MP3 or CD).
There is a MediaPlayer(object) that has two other Objects, a CDPlayer(object) and mp3Player(object)
The user inputs the songObjects list into a media player, calls the play method, and for each song the user expects back a string that lists the song name and the device it was played on.
when calling the play method, the user does not care if the song is played on a cd player or the mp3 Player, only that the song is played and they get a string back stating this, and the device it was played on.
I have some source code but its all over the place as im having trouble implementing this. Is this a valid example?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to write a regularexpression for datatype in c sharp, datatype means start with a letter or underscore then anything(letter, digit,underscore)
C# Deployment