コード例 #1
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();

        }
コード例 #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();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

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

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

            LoadApplication(runner);
        }
コード例 #5
0
        //
        // 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));
        }
コード例 #6
0
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

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

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

            LoadApplication(runner);
        }
コード例 #7
0
        protected RunnerApplicationPage()
        {
            Forms.Init();

            OnInitializeRunner();

            Initialized = true;

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

            LoadApplication(runner);
        }
コード例 #8
0
        //
        // 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));
        }
コード例 #9
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;

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

            Initialized = true;

            LoadApplication(runner);
        }
コード例 #10
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;

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

            Initialized = true;

            LoadApplication(runner);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: RunnerActivity.cs プロジェクト: xunit/devices.xunit
        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);
        }
コード例 #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);
        }
コード例 #14
0
 /// <summary>
 /// Создание,запуск и работа с отчетами о клиенте.
 /// </summary>
 public static void CreateReport()
 {
     FormsRunner.RunReportForm();
 }
コード例 #15
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);
            
            
#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();

        }
コード例 #16
0
 /// <summary>
 ///     Запрос Пароля Суперпользователя если необходимо. Запускает событие LockChangedEvent.
 /// </summary>
 public static void AccessRootUser()
 {
     FormsRunner.RunPasswordForm();
 }
コード例 #17
0
 /// <summary>
 /// Создание,запуск формы выбора Администратора
 /// </summary>
 public static void SelectCurentAdmin()
 {
     FormsRunner.RunAdminForm();
 }
コード例 #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);
        }