BlackBerry.Navigator.HandleEvent C# (CSharp) Method

HandleEvent() public method

public HandleEvent ( IntPtr eventHandle ) : void
eventHandle IntPtr
return void
        void HandleEvent(IntPtr eventHandle)
        {
            var type = (EventType)new Event (eventHandle).Code;

            switch (type) {
            case EventType.NAVIGATOR_LOW_MEMORY:
                Console.WriteLine ("Navigator is afraid the mem could be too low, running GC.");
                GC.Collect();
              			GC.WaitForPendingFinalizers();
                break;
            case EventType.NAVIGATOR_EXIT:
                if (OnExit != null) {
                    OnExit ();
                }
                break;
            case EventType.NAVIGATOR_SWIPE_DOWN:
                if (OnSwipeDown != null) {
                    OnSwipeDown ();
                }
                break;
            case EventType.NAVIGATOR_INVOKE_TARGET_RESULT:
                if (OnInvokeResult != null) {
                    OnInvokeResult (new InvokeTargetReply (eventHandle));
                }
                break;
            default:
                Console.WriteLine ("UNHANDLED NAVIGATOR EVENT, TYPE: {0}", type);
                break;
            }
        }