Click here to Skip to main content
16,004,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: VB6 COM Interface Question Pin
MSBassSinger9-Oct-08 7:54
professionalMSBassSinger9-Oct-08 7:54 
QuestionAll these event handlers Pin
Dewald9-Oct-08 3:56
Dewald9-Oct-08 3:56 
AnswerRe: All these event handlers Pin
DaveyM699-Oct-08 4:43
professionalDaveyM699-Oct-08 4:43 
GeneralRe: All these event handlers Pin
Dewald9-Oct-08 5:11
Dewald9-Oct-08 5:11 
AnswerRe: All these event handlers Pin
led mike9-Oct-08 4:47
led mike9-Oct-08 4:47 
AnswerRe: All these event handlers Pin
S. Senthil Kumar9-Oct-08 5:00
S. Senthil Kumar9-Oct-08 5:00 
GeneralRe: All these event handlers Pin
Dewald9-Oct-08 5:20
Dewald9-Oct-08 5:20 
GeneralRe: All these event handlers Pin
S. Senthil Kumar9-Oct-08 5:34
S. Senthil Kumar9-Oct-08 5:34 
Dewald wrote:
Would you mind elaborating a bit?


The interface is to avoid a direct dependency from MessageEngine to FrameEngine, so that you can provide varying implementations of FrameEngine. Something like
interface IFrameEngine
{
event MessageReceived;
void SendMessage(...);
}

class DefaultFrameEngine : IFrameEngine
{
   public event MessageReceived;

   public void SendMesssage(...) {...}

   protected void RaiseMessageReceived(...) {...}
}

class MessageEngine
{
   IFrameEngine frameEngine;

   internal MessageEngine(IFrameEngine frameEngine)
   {
       this.frameEngine = frameEngine;
       this.frameEngine.MessageReceived += ....(HandleMessageReceived)
   }

   internal void HandleMessageReceived(...)
   {
     if (mustSendMesssage)
       frameEngine.SendMessage(...);
   }
}


You could then write a OptimizedFrameEngine, implementing the same interface, and pass it to MessageEngine, and MessageEngine wouldn't know about it.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Home Page |My Blog | My Articles | My Flickr | WinMacro

GeneralRe: All these event handlers Pin
Dewald9-Oct-08 23:02
Dewald9-Oct-08 23:02 
QuestionIncluding c# v2.0 library in a c# v1.1 library. [modified] Pin
Spoon659-Oct-08 2:40
Spoon659-Oct-08 2:40 
AnswerRe: Including c# v2.0 library in a c# v1.3 library. Pin
Pete O'Hanlon9-Oct-08 3:00
mvePete O'Hanlon9-Oct-08 3:00 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon659-Oct-08 3:08
Spoon659-Oct-08 3:08 
AnswerRe: Including c# v2.0 library in a c# v1.1 library. Pin
Guffa9-Oct-08 3:12
Guffa9-Oct-08 3:12 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon659-Oct-08 3:52
Spoon659-Oct-08 3:52 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dave Kreskowiak9-Oct-08 5:24
mveDave Kreskowiak9-Oct-08 5:24 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon659-Oct-08 22:11
Spoon659-Oct-08 22:11 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon6513-Oct-08 22:37
Spoon6513-Oct-08 22:37 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dave Kreskowiak14-Oct-08 1:52
mveDave Kreskowiak14-Oct-08 1:52 
AnswerRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dan Neely9-Oct-08 4:06
Dan Neely9-Oct-08 4:06 
QuestionTabular crystal reports using query not through wizard Pin
tanvir20909-Oct-08 2:11
tanvir20909-Oct-08 2:11 
JokeRe: Tabular crystal reports using query not through wizard Pin
nelsonpaixao9-Oct-08 13:46
nelsonpaixao9-Oct-08 13:46 
QuestionStartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 0:25
Piratenwichtl20009-Oct-08 0:25 
AnswerRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 3:53
S. Senthil Kumar9-Oct-08 3:53 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 4:10
Piratenwichtl20009-Oct-08 4:10 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 4:51
S. Senthil Kumar9-Oct-08 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.