示例#1
0
        /// <summary>
        /// </summary>
        /// <param name="type"></param>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal override void handleEvent(EventType type, Object sender, EventArgs e)
        {
            ControlsMap  controlsMap = ControlsMap.getInstance();
            MgWebBrowser webBroswer  = (MgWebBrowser)sender;

            MapData mapData = controlsMap.getMapData(webBroswer);

            if (mapData == null)
            {
                return;
            }

            GuiMgControl guiMgCtrl      = mapData.getControl();
            var          contextIDGuard = new Manager.ContextIDGuard(Manager.GetContextID(guiMgCtrl));

            try
            {
                switch (type)
                {
                case EventType.GOT_FOCUS:
                    Events.OnFocus(guiMgCtrl, 0, false, false);
                    return;

                case EventType.DISPOSED:
                    break;

#if !PocketPC
                case EventType.STATUS_TEXT_CHANGED:
                    String statusText         = webBroswer.StatusText.Trim();
                    String previousStatusText = ((TagData)webBroswer.Tag).BrowserControlStatusText;
                    if (statusText.Length > 0 && !statusText.Equals(previousStatusText))
                    {
                        ((TagData)webBroswer.Tag).BrowserControlStatusText = statusText;
                        Events.OnBrowserStatusTxtChange(guiMgCtrl, statusText);
                    }
                    break;
#endif

                case EventType.EXTERNAL_EVENT:
                    ExternalEventArgs args = (ExternalEventArgs)e;
                    Events.OnBrowserExternalEvent(guiMgCtrl, args.Param);
                    break;
                }
            }
            finally
            {
                contextIDGuard.Dispose();
            }
            DefaultHandler.getInstance().handleEvent(type, sender, e);
        }
示例#2
0
 internal void ExternalEventHandler(object sender, ExternalEventArgs e)
 {
     handleEvent(EventType.EXTERNAL_EVENT, sender, e);
 }