Hi all ,

        Im experimenting with  some simple patterns and in particular
events and using the event args to send the appropriate data. 

The problem I get, is when I implement this via an interface the event
in the interface seems to require the non generic EventHandler. 

Ie 

public interface IObservable
        {
             event EventHandler Changed;  
        }

public interface IObservable<T>
        {
             event EventHandler<T> Changed;  
        }

Is illegal as the event does not like the generic type.  So I implement
a second interface with the specific argument I need 

Public interface ITypedObserver , IObservable 
{
        new event EventHandler<ScannerEventArgs> Changed;    // this
does not  seem to override the IObservable event 
} 

But when I implement the class it still requires the non Generic
EventHandler despite the new.  ( without the new it tells me to put the
new in to hide the parent) 

Can anyone shed some light on how to do this  ?  Or to set a generic
event  in an interface ? 

             Regards , 
        
                     Ben 

PS: Using .Net 2.0 RC 
#####################################################################################
Note:
This message is for the named person's use only.  It may contain confidential,
proprietary or legally privileged information.  No confidentiality or privilege
is waived or lost by any mistransmission.  If you receive this message in error,
please immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender.  You must not, directly or indirectly,
use, disclose, distribute, print, or copy any part of this message if you are 
not
the intended recipient. THIS COMPANY NAME and any of its subsidiaries each 
reserve
the right to monitor all e-mail communications through its networks.

Any views expressed in this message are those of the individual sender, except 
where
the message states otherwise and the sender is authorized to state them to be 
the
views of any such entity.

Thank You.
#####################################################################################

#####################################################################################

This email has been scanned by MailMarshal, an email content filter. 

#####################################################################################

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to