Automobile.Mobile.iOS.Automation.iOSWebClient.iOSWebClient C# (CSharp) Method

iOSWebClient() public method

public iOSWebClient ( UIWebView view ) : System
view UIWebView
return System
        public iOSWebClient(UIWebView view)
        {
            // syncs ready state across threads
            LoadTrigger = new EventWaitHandle(true, EventResetMode.ManualReset);

            // Set event handlers
            view.LoadStarted += LoadStarted;
            view.LoadFinished += LoadFinished;
            view.LoadError += LoadError;
            view.ShouldStartLoad = ShouldStartLoad;
            _view = view;

            // Used to wait a (few) sec on page load in case of a redirect
            // TODO: make config-able? better way to do this?
            _timer = new System.Timers.Timer(2000);
            _timer.Elapsed += (sender, e) => LoadTrigger.Set();
        }