Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Thursday, March 22, 2012

Delayed Send

Hi

My application sends notifications by creating a once-off subcription, then raising an event in Notification Services. This causes the notification to be issued immediately.

I want to be able to create a notification that is not sent until some time in the future. I'm not sure if I should be looking at ScheduledRules or EventRules.

Has anyone done anything similar?

Thanks

Robert.

Event driven rules produce notifications as events come into the notification application. Scheduled rules create notifications according to the schedule defined in the subscription. Take a look at the ScheduleRecurrence and ScheduleStart properties of the Subscription class.

HTH...

Joe

Friday, March 9, 2012

Defining an event inside of an assembly => UNSAFE (no workarounds?)

Can someone verify that an assembly containing an interface with an event definition, such as...

public interface A {
event EventHandler Foo;
}

... can never be loaded under SAFE or EXTERNAL_ACCESS ?

It appears that the compiler-generated add_xxx and remove_xxx have the MethodImpl(MethodImplOptions.Synchronized) attribute defined by default, and "Explicit synchronization is not allowed". The same limitation also applies to classes by default, although technically one is able to define the implementation directly (clearly not ideal).

That's exactly correct. There is some possibility in the future that the CLR could change the way they implement EventHandler synchronization to allow it in non-unsafe assemblies, but for now that is the restricition.

Steven