/// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Xamarin.Forms.Forms.Init(e);

            var rootFrame = Window.Current.Content as RunnerPage;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window

                OnInitializeRunner();

                Initialized = true;

                RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
                RunnerOptions.Current.AutoStart = AutoStart;

                var runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

                var page = new RunnerPage(runner);

                Window.Current.Content = page;
            }
            
            // Ensure the current window is active
            Window.Current.Activate();

        }
Beispiel #2
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Xamarin.Forms.Forms.Init(e);

            var rootFrame = Window.Current.Content as RunnerPage;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window

                OnInitializeRunner();

                Initialized = true;

                RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
                RunnerOptions.Current.AutoStart = AutoStart;

                var runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

                var page = new RunnerPage(runner);

                Window.Current.Content = page;
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            Forms.Init(this);

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            runner = new FormsRunner(executionAssembly, testAssemblies, ResultChannel ?? new TextWriterResultChannel(Writer));
            LoadApplication(runner);
        }
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            var runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

            LoadApplication(runner);
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            Forms.Init();

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

            Initialized = true;

            LoadApplication(runner);

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            var runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

            LoadApplication(runner);
        }
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

            var runner = new FormsRunner(executionAssembly, testAssemblies)
            {
                TerminateAfterExecution = TerminateAfterExecution,
                Writer = Writer,
                AutoStart = AutoStart,
            };

            LoadApplication(runner);
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            Forms.Init();

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

#pragma warning disable CS0618 // Type or member is obsolete
            runner = new FormsRunner(executionAssembly, testAssemblies, ResultChannel ?? new TextWriterResultChannel(Writer));
#pragma warning restore CS0618 // Type or member is obsolete

            Initialized = true;

            LoadApplication(runner);

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            PlatformHelpers.Assets = Assets;

            Forms.Init(this, bundle);

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

            Initialized = true;

            LoadApplication(runner);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            PlatformHelpers.Assets = Assets;

            Forms.Init(this, bundle);

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

            runner = new FormsRunner(executionAssembly, testAssemblies, Writer);

            Initialized = true;

            LoadApplication(runner);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Forms.Init(this, bundle);

            
            runner = new FormsRunner(executionAssembly, testAssemblies)
            {
                TerminateAfterExecution = TerminateAfterExecution,
                Writer = Writer,
                AutoStart = AutoStart
            };

            Initialized = true;

            LoadApplication(runner);
        }
Beispiel #12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            PlatformHelpers.Assets = Assets;

            Forms.Init(this, bundle);

            RunnerOptions.Current.TerminateAfterExecution = TerminateAfterExecution;
            RunnerOptions.Current.AutoStart = AutoStart;

#pragma warning disable CS0618 // Type or member is obsolete
            runner = new FormsRunner(executionAssembly, testAssemblies, ResultChannel ?? new TextWriterResultChannel(Writer));
#pragma warning restore CS0618 // Type or member is obsolete

            Initialized = true;

            LoadApplication(runner);
        }
Beispiel #13
0
        public static bool AddAbonement(string personName)
        {
            // Для справки. В архив абонементов новый добавляемый абонемент добавляется в форме абонементов AbonementForm
            // именно там он создается. Поэтому сразу и добавляем там

            var person = PersonObject.GetLink(personName);

            if (person == null)
            {
                return(false);
            }

            var dialogResult = FormsRunner.CreateAbonementForm(person.Name);

            //if (dialogResult == DialogResult.OK)
            //{
            //    AbonementController.GetInstance().Save();
            //    return true;
            //}
            return(false);
        }
Beispiel #14
0
 /// <summary>
 /// Создание,запуск и работа с отчетами о клиенте.
 /// </summary>
 public static void CreateReport()
 {
     FormsRunner.RunReportForm();
 }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Xamarin.Forms.Forms.Init(e);
            
            
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootFrame = Window.Current.Content as RunnerPage;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window

                OnInitializeRunner();

                Initialized = true;

                var runner = new FormsRunner(executionAssembly, testAssemblies)
                {
                    TerminateAfterExecution = TerminateAfterExecution,
                    Writer = Writer,
                    AutoStart = AutoStart,
                };

                var page = new RunnerPage(runner);

                Window.Current.Content = page;
            }
            
            // Ensure the current window is active
            Window.Current.Activate();

        }
Beispiel #16
0
 /// <summary>
 ///     Запрос Пароля Суперпользователя если необходимо. Запускает событие LockChangedEvent.
 /// </summary>
 public static void AccessRootUser()
 {
     FormsRunner.RunPasswordForm();
 }
Beispiel #17
0
 /// <summary>
 /// Создание,запуск формы выбора Администратора
 /// </summary>
 public static void SelectCurentAdmin()
 {
     FormsRunner.RunAdminForm();
 }
Beispiel #18
0
        /// <summary>
        /// Отметить посещение. Запускается логика из текущего абонемента, а так же запускается событие для добавления
        /// в списки на главной форме
        /// </summary>
        /// <param name="personName"></param>
        /// <returns></returns>
        public bool CheckInWorkout(string personName)
        {
            var person = PersonObject.GetLink(personName);

            if (person.AbonementCurent == null)
            {
                return(false);
            }

            if (!IsAbonementValid(ref person))
            {
                return(false);
            }

            // Проверка на дубляж посещений. Если сегодня уже клиент ходил - задать вопрос
            var isAlreadyVisited = PersonObject.IsVisitToday(personName, out var infoMessage);

            if (isAlreadyVisited)
            {
                var dialogResult = MessageBox.Show($@"Повторно отметить посещение?

{infoMessage}", @"Сегодня клиент уже отмечался!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.No)
                {
                    return(false);
                }
            }


            var selectedOptions = new WorkoutOptions();

            bool isSuccess;

            switch (person.AbonementCurent)
            {
            case AbonementByDays byDays:
            {
                var dlgResult = FormsRunner.RunWorkoutOptionsForm(ref selectedOptions, person.Name);
                if (dlgResult == DialogResult.Cancel)
                {
                    return(false);
                }

                person.AbonementCurent.TryActivate(DateTime.Now.Date);   // Если не Активирован

                isSuccess = byDays.CheckInWorkout(selectedOptions.TypeWorkout);
                if (!isSuccess)
                {
                    return(false);
                }
                PersonObject.SaveCurentVisit(person, selectedOptions);   // Сохраняет текущий визит
                break;
            }

            case ClubCardA clubCardA:
            {
                var dlgResult = FormsRunner.RunWorkoutOptionsForm(ref selectedOptions, person.Name);
                if (dlgResult == DialogResult.Cancel)
                {
                    return(false);
                }

                person.AbonementCurent.TryActivate(DateTime.Now.Date);   // Если не Активирован

                isSuccess = clubCardA.CheckInWorkout(selectedOptions.TypeWorkout);
                if (!isSuccess)
                {
                    return(false);
                }
                PersonObject.SaveCurentVisit(person, selectedOptions);   // Сохраняет текущий визит
                break;
            }

            case SingleVisit singleVisit:
            {
                var dlgResult = FormsRunner.RunWorkoutOptionsForm(ref selectedOptions, person.Name);
                if (dlgResult == DialogResult.Cancel)
                {
                    return(false);
                }

                person.AbonementCurent.TryActivate(DateTime.Now.Date);   // Если не Активирован

                isSuccess = singleVisit.CheckInWorkout(person.AbonementCurent.TypeWorkout);

                if (!isSuccess)
                {
                    return(false);
                }
                PersonObject.SaveCurentVisit(person, selectedOptions);   // Сохраняет текущий визит
                break;
            }
            }

            _dailyVisits.AddToLog(personName, selectedOptions); // Cобытие для добавления текущего посещения на главную форму

            IsAbonementValid(ref person);
            MessageBox.Show(@"Тренировка Учтена!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //  AbonementController.GetInstance().Save();
            DailyVisits.GetInstance().Serialize();


            return(true);
        }