How to Implement Events?

Oct 31, 2009 at 4:41 PM
Edited Oct 31, 2009 at 4:43 PM

Hello,

i want to know how to implement an Event in the contract.  Let's say i have a following contract:

 

    [AddInContract()]
public interface IContract1 : IContract
{
string SiteName { get; }
System.Uri RegistrationUrl { get; }

bool Register();
}

 

Now i want to add an event to this contract, like RegistrationCompletedEvent. The AddIn should be able to raise this event.

I'm trying to implement that stupid event since 2 hours, but it doesn't work.

If i write  "event EventHandler RegistrationCompleted;" into the interface and than run the PipeLineBuilder, then i am able to implement some new methods into my AddIn but i can't compile the whole project because there is an error in "IContract1ViewToContractHostAdapter.g.cs" (HostSideAdapters) and "IContract1ViewToContractAddInAdapter.g.cs" (AddInSideAdapters)
There is something wrong with the method: "add_RegistrationCompleted".

So now i want to ask somebody if he can tell me how to implement an event into my Contract.

 

 

Coordinator
Nov 2, 2009 at 2:51 PM

Isn't there a special event class in System.AddIns.*?

There are samples in the source code which has eventing. Try to use them, or otherwise, what is different, or don't the samples work?

If there's a bug I could give you access to update the code if you fix it.

Cheers