Ejemplo n.º 1
0
        private async void ControlLogin1SetLogin(object sender, FirebaseLib e)
        {
            Settings.User = e.UserName;
            Settings.PasswordDecrypted = e.Password;
            Settings.SaveLocal();
            tileBarItem1.Enabled     = true;
            tileBarItem3.Enabled     = true;
            controlStation1.FireBase = e;
            await controlStation1.GetStation();

            controlAddFlight1.FireBase = e;
            if (controlStation1.StationObject != null)
            {
                tileBarItem2.Enabled              = true;
                controlAddFlight1.StationId       = controlStation1.StationObject?.Object?.Id ?? 0;
                navigationFrame.SelectedPageIndex = 3;
            }
            else
            {
                navigationFrame.SelectedPageIndex = 2;
            }
        }
Ejemplo n.º 2
0
        private void FormBackend_Load(object sender, EventArgs e)
        {
            FireBase = new FirebaseLib(Settings);
            controlLogin1.FireBase                = FireBase;
            controlLogin1.Settings                = Settings;
            controlStation1.FireBase              = FireBase;
            controlStation1.StationSetting        = StationSetting;
            controlLogin1.SetLogin               += ControlLogin1SetLogin;
            controlAddFlight1.FireBase            = FireBase;
            controlAddFlight1.Sounding            = Sounding;
            controlAddFlight1.Temp100FileName     = Temp100FileName;
            controlAddFlight1.TempEndFileName     = TempEndFileName;
            controlAddUserStation1.FireBase       = FireBase;
            controlAddUserStation1.Settings       = Settings;
            controlAddUserStation1.StationSetting = StationSetting;
            controlLicence1.Protection            = Protection;

            navigationFrame.SelectedPageChanged += (o, args) =>
            {
                var frame = args.Page.Parent as NavigationFrame;
                var page  = frame.SelectedPage;
                var index = frame.SelectedPageIndex;

                if (_oldIndex == 6)
                {
                    Console.WriteLine("Catched");
                    controlSettings1.Save();
                }

                _oldIndex = index;
            };

            navigationFrame.QueryControl += (o, args) =>
            {
                Console.WriteLine("test");
            };
        }