static void Main(string[] args) { var Container = new VideoPlayerShell(); var CodecChooser = new VideoCodecs(); // fix codec CodecChooser.PlayWithFixedCodec(); // fix codec choice // Allow variety var inputChoice = 1; var delegateInstance01 = new VideoPlayerShell.myDelegate(CodecChooser.PlayWithCodec01); var delegateInstance02 = new VideoPlayerShell.myDelegate(CodecChooser.PlayWithCodec02); var success = 0; if (inputChoice == 1) { success = Container.PlayFile(delegateInstance01); } else { success = Container.PlayFile(delegateInstance02); } Console.WriteLine("Successful? {0} ", Convert.ToBoolean(success)); }
public delegate int myDelegate(); // USE TO PLAY VIDEOS BUT DON'T SPECIFY A METHOD YET public int PlayFile(VideoPlayerShell.myDelegate videoDelegateInstance) { return(videoDelegateInstance()); }