Esempio n. 1
0
        public void SaveToXml()
        {
            WindowTheme.SaveToXml(Xml, "Window");

            LoginLabel.SaveToXml(Xml, "LoginButton");
            NewAccountLabel.SaveToXml(Xml, "NewAccountButton");
            AccountSettingsLabel.SaveToXml(Xml, "AccountSettingsButton");
            HelpLabel.SaveToXml(Xml, "HelpButton");
            CreditsLabel.SaveToXml(Xml, "CreditsButton");
            ExitLabel.SaveToXml(Xml, "ExitButton");

            Xml.Save();
        }
        void ReleaseDesignerOutlets()
        {
            if (AlertImage != null)
            {
                AlertImage.Dispose();
                AlertImage = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (Tableview != null)
            {
                Tableview.Dispose();
                Tableview = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddSeekiosButton != null)
            {
                AddSeekiosButton.Dispose();
                AddSeekiosButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (UserImageView != null)
            {
                UserImageView.Dispose();
                UserImageView = null;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // button click seekios tutorial
            SeekiosTutorialButton.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToListTutorial();
            }));

            // button click my consomation
            HistoriqueConsommationButton.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.Credits.GoToCreditHistoric();
            }));

            // button click on add a seekios
            AddSeekiosButton.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToAddSeekios();
            }));

            // button click on map all seekios
            MapButton.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (App.CurrentUserEnvironment.LsSeekios.Count == 0)
                {
                    AlertControllerHelper.ShowAlert(Application.LocalizedString("ZeroSeekios")
                                                    , Application.LocalizedString("NeedAtLeastOneSeekios")
                                                    , Application.LocalizedString("Close"));
                }
                else
                {
                    if (App.CurrentUserEnvironment.LsSeekios.All(a => a.LastKnownLocation_latitude == App.DefaultLatitude &&
                                                                 a.LastKnownLocation_longitude == App.DefaultLongitude))
                    {
                        if (App.CurrentUserEnvironment.LsSeekios.Count == 1)
                        {
                            AlertControllerHelper.ShowAlert(Application.LocalizedString("NoPosition")
                                                            , Application.LocalizedString("OneSeekiosNewlyAdded")
                                                            , Application.LocalizedString("Close"));
                        }
                        else
                        {
                            AlertControllerHelper.ShowAlert(Application.LocalizedString("NoPosition")
                                                            , Application.LocalizedString("PluralSeekiosNewlyAdded")
                                                            , Application.LocalizedString("Close"));
                        }
                    }
                    else
                    {
                        NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                        App.Locator.LeftMenu.GoToSeekiosMapAllSeekios();
                    }
                }
            }));

            // button click on feedback
            FeedbackButton.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                var feedbackManager = BITHockeyManager.SharedHockeyManager.FeedbackManager;
                feedbackManager.ShowFeedbackListView();
                feedbackManager.ShowFeedbackComposeView();
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
            }));

            // button click on Parameter
            UserImageView.UserInteractionEnabled = true;
            UserImageView.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
            EmailUser.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
            NameUser.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
            SettingsImageView.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
            CreditsTitleLabel.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
            CreditsLabel.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true);
                App.Locator.LeftMenu.GoToParameter();
            }));
        }