Export (0) Print
Expand All

MessageInterceptor Class

Windows Mobile 6.5
3/29/2010

Raises an event when an arriving SMS message satisfies the interception rule condition.

Namespace: Microsoft.WindowsMobile.PocketOutlook.MessageInterception
Assembly: Microsoft.WindowsMobile.PocketOutlook (in microsoft.windowsmobile.pocketoutlook.dll)

public class MessageInterceptor : IDisposable, IApplicationLauncher

When defining an instance of MessageInterceptor that is going to handle the MessageReceived event, make sure that the instance is defined globally in the class where the event will be handled. If it is defined in a method, it will be up for garbage collection after it goes out of scope.

public class InterceptorClass
{
    MessageInterceptor interceptor; // defined globally to class
    private void Form1_Load(object sender, EventArgs e)
    {
        // MessageInterceptor interceptor;  // This instance will go out of scope if defined here

        interceptor = new MessageInterceptor(ruleName);
        interceptor.MessageReceived += new MessageInterceptorEventHandler(interceptor_MessageReceived);
    }
}


System.Object
  Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptor

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.
Show:
© 2014 Microsoft