Ejemplo n.º 1
0
 void GoToBack()
 {
     if (LTWebView.CanGoBack && !_prevUrl.Contains(Constants.LoginUrl))
     {
         LTWebView.GoBack();
     }
 }
Ejemplo n.º 2
0
        partial void ActionLogOut(UIButton sender)
        {
            LTWebView.LoadRequest(new NSUrlRequest(new NSUrl(_appSettings.LatestUrl)));

            NSUrlCache.SharedCache.RemoveAllCachedResponses();
            foreach (NSHttpCookie cookie in NSHttpCookieStorage.SharedStorage.Cookies)
            {
                NSHttpCookieStorage.SharedStorage.DeleteCookie(cookie);
            }
            _isLoggedOut = true;
            NavigationController.NavigationBar.Hidden = true;
            _appSettings.IsLoggedIn = false;
            _appSettings.MxData     = null;
            _appSettings.Save();
            CloseMenu();

            LoginVC ltNVC = Storyboard.InstantiateViewController("LoginVC") as LoginVC;

            this.PresentViewController(ltNVC, true, null);
        }
        void ReleaseDesignerOutlets()
        {
            if (imgLogo != null)
            {
                imgLogo.Dispose();
                imgLogo = null;
            }

            if (LTWebView != null)
            {
                LTWebView.Dispose();
                LTWebView = null;
            }

            if (menuContent != null)
            {
                menuContent.Dispose();
                menuContent = null;
            }
        }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            LTWebView.LoadStarted  += HandleLoadStarted;
            LTWebView.LoadError    += HandleLoadError;
            LTWebView.LoadFinished += HandleLoadFinished;

            _appSettings.Load();

            InitUISettings();

            var homepageURL = _appSettings.LatestUrl;

            if (AppSettingsBase.OverrideUrl != null || _appSettings.MxData != null && !string.IsNullOrEmpty(_appSettings.MxData.homepageURL))
            {
                homepageURL            = AppSettingsBase.OverrideUrl ?? _appSettings.MxData.homepageURL;
                _appSettings.LatestUrl = homepageURL;
            }
            LTWebView.LoadRequest(new NSUrlRequest(new NSUrl(homepageURL)));
        }
Ejemplo n.º 5
0
        void HandleLoadFinished(object sender, EventArgs e)
        {
            //var b = (sender as UIWebView).IsLoading;
            // _ProgressBar.Hidden = true;

            if (_isLoggedOut)
            {
                return;
            }

            var strURL = LTWebView.Request.Url.AbsoluteString;

            if (strURL.Contains(Constants.LoginUrl))
            {
                _appSettings.IsLoggedIn = false;

                LTWebView.EvaluateJavascript(string.Format(Constants.JsFillEmail, _email));
            }
            else
            {
                _appSettings.IsLoggedIn = true;
            }

            string cssString = Constants.CssHideTopBar;
            string jsString  = Constants.JsHideBottomBar;
            string jsWithCSS = string.Format(jsString, cssString);

            LTWebView.EvaluateJavascript(jsWithCSS);

            if (_url != LTWebView.Request.Url.AbsoluteString)
            {
                _prevUrl = _url;
                _url     = LTWebView.Request.Url.AbsoluteString;
            }

            Console.WriteLine(_url);
        }
Ejemplo n.º 6
0
 partial void ActionStartPage(UIButton sender)
 {
     LTWebView.LoadRequest(new NSUrlRequest(new NSUrl(_appSettings.LatestUrl)));
     AnimateMenuToggle();
 }
Ejemplo n.º 7
0
 void Refresh()
 {
     LTWebView.Reload();
 }