Пример #1
0
        public async Task <IActionResult> Index()
        {
            // Creates an instance of the SplashView View Model
            var splash = new SplashView();
            // Grabs all Training Programs and puts them in a list
            var trainingPrograms = await _context.TrainingProgram.ToListAsync();

            // Creates an intance to hold only training programs that are within 4 weeks of Datetime Now
            var trainingProgramsWithinFourWeeks = new List <TrainingProgram>();

            // Loops through all training programs in the database
            foreach (var tp in trainingPrograms)
            {
                // Selects only training programs that start between Dattime Now and 28 days from Datetime Now
                if (tp.StartDate <= DateTime.Now.AddDays(28) && tp.StartDate > DateTime.Now)
                {
                    trainingProgramsWithinFourWeeks.Add(tp);
                }
            }
            // Sets the ViewModel object equal to the Selected List of Training Programs
            splash.TrainingPrograms = trainingProgramsWithinFourWeeks;
            // Grabs all the Employees from the database, Includes their department Orders by the Last added and takes only 5
            splash.Employees = await _context.Employee.Include(e => e.Department).OrderByDescending(e => e.StartDate).Take(5).ToListAsync();

            // Returns the View Model object to the razor template
            return(View(splash));
        }
Пример #2
0
        protected override void OnExit(ExitEventArgs e)
        {
            var applicationTracker = CustomContainer.Get <IApplicationTracker>();

            //Stop the action tracking
            applicationTracker?.DisableApplicationTracker();

            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }

            catch

            {
                // Best effort ;)
            }

            ForceShutdown();
        }
Пример #3
0
        public App()
        {
            InitializeComponent();

            // MainPage = new MainPage();
            MainPage = new SplashView();
        }
Пример #4
0
        public void PerformStartup( )
        {
            // force a quick layout update
            ViewDidLayoutSubviews( );

            SplashView.PerformStartup( );
        }
Пример #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Config config = new Config();

            try
            {
                config.LoadWithoutEvent();
            }
            catch
            {
            }

            if (config.FirstTimeStarted)
            {
                SplashView splash = new SplashView();
                splash.IsVisibleChanged += splash_IsVisibleChanged;
                splash.Show();
            }
            else
            {
                StartMain(config.IsTradingPostDataProvider);
            }
        }
Пример #6
0
        /// <summary>
        /// Displays the splash screen (whose presenter builds up most of the objects used by the program) and then the
        /// main view once the splash screen has finished. When the main view quits the program shuts down.
        /// </summary>
        /// <param name="args"></param>
        private static void StartApplication(string[] args)
        {
            IUniversalPlugAndPlayManager uPnpManager                  = null;
            IBaseStationAircraftList     baseStationAircraftList      = null;
            ISimpleAircraftList          flightSimulatorXAircraftList = null;
            bool loadSucceded = false;

            using (var splashScreen = new SplashView()) {
                splashScreen.Initialise(args, BackgroundThread_ExceptionCaught);
                splashScreen.ShowDialog();

                loadSucceded                 = splashScreen.LoadSucceeded;
                uPnpManager                  = splashScreen.UPnpManager;
                baseStationAircraftList      = splashScreen.BaseStationAircraftList;
                flightSimulatorXAircraftList = splashScreen.FlightSimulatorXAircraftList;
            }

            try {
                if (loadSucceded)
                {
                    using (var mainWindow = new MainView()) {
                        _MainView = mainWindow;
                        mainWindow.Initialise(uPnpManager, baseStationAircraftList, flightSimulatorXAircraftList);
                        mainWindow.ShowDialog();
                    }
                }
            } finally {
                using (var shutdownWindow = new ShutdownView()) {
                    shutdownWindow.Initialise(uPnpManager, baseStationAircraftList);
                    shutdownWindow.ShowDialog();
                    Thread.Sleep(1000);
                }
            }
        }
Пример #7
0
        public override void OnResume()
        {
            base.OnResume();

            System.Timers.Timer timer = new System.Timers.Timer();
            timer.Interval  = 750;
            timer.AutoReset = false;
            timer.Elapsed  += (object sender, System.Timers.ElapsedEventArgs e) =>
            {
                Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                {
                    SplashView.PerformStartup( );

                    SimpleAnimator_Float viewAlphaAnim = new SimpleAnimator_Float(ContainerView.Alpha, 0.00f, .25f, delegate(float percent, object value)
                    {
                        ContainerView.Alpha = (float)value;
                    },
                                                                                  null);
                    viewAlphaAnim.Start( );
                });
            };
            timer.Start( );

            SpringboardParent.ModalFragmentOpened(this);

            Point displaySize = new Point( );

            Activity.WindowManager.DefaultDisplay.GetSize(displaySize);
            SplashView.LayoutChanged(new System.Drawing.RectangleF(0, 0, displaySize.X, displaySize.Y));
        }
        private void LoadAd()
        {
            Log.Info(TAG, "Start to load ad");

            AdParam adParam = new AdParam.Builder().Build();


            splashView = FindViewById <SplashView>(Resource.Id.splash_ad_view);
            splashView.SetAdDisplayListener(new SplashAdDisplayListeners());
            Log.Info(TAG, "SplashView.SetAdDisplayListener function called successfully.");
            // Set a default app launch image.
            splashView.SetSloganResId(Resource.Drawable.default_slogan);
            Log.Info(TAG, "SplashView.SetSloganResId function called successfully.");
            splashView.SetWideSloganResId(Resource.Drawable.default_slogan);
            Log.Info(TAG, "SplashView.SetWideSloganResId function called successfully.");

            splashView.SetLogoResId(Resource.Mipmap.ic_launcher);
            Log.Info(TAG, "SplashView.SetLogoResId function called successfully.");
            // Set logo description.
            splashView.SetMediaNameResId(Resource.String.media_name);
            Log.Info(TAG, "SplashView.SetMediaNameResId function called successfully.");
            // Set the audio focus type for a video splash ad.
            splashView.SetAudioFocusType(AudioFocusType.NotGainAudioFocusWhenMute);
            Log.Info(TAG, "SplashView.SetAudioFocusType function called successfully.");
            SplashView.SplashAdLoadListener splashListener = new SplashListener(this);

            splashView.Load(GetString(Resource.String.ad_id_splash), (int)ScreenOrientation.Portrait, adParam, splashListener);
            Log.Info(TAG, "SplashView.Load function called successfully.");

            // Remove the timeout message from the message queue.
            timeoutHandler.RemoveMessages(MsgAdTimeout);
            // Send a delay message to ensure that the app home screen can be displayed when the ad display times out.
            timeoutHandler.SendEmptyMessageDelayed(MsgAdTimeout, AdTimeout);
        }
Пример #9
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            View.Bounds = Springboard.View.Bounds;

            SplashView.LayoutChanged(View.Bounds.ToRectF( ));
        }
Пример #10
0
 private void ShowSplash()
 {
     var splashScreenWindow = new SplashView();
     SplashScreen = splashScreenWindow;
     splashScreenWindow.Show();
     _resetSplashCreated.Set();
     Dispatcher.Run();
 }
Пример #11
0
        private void ShowSplash()
        {
            var splashScreenWindow = new SplashView();

            SplashScreen = splashScreenWindow;
            splashScreenWindow.Show();
            _resetSplashCreated.Set();
            Dispatcher.Run();
        }
Пример #12
0
        public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
        {
            base.OnConfigurationChanged(newConfig);

            Point displaySize = new Point( );

            Activity.WindowManager.DefaultDisplay.GetSize(displaySize);
            SplashView.LayoutChanged(new System.Drawing.RectangleF(0, 0, displaySize.X, displaySize.Y));
        }
Пример #13
0
 public new void Shutdown()
 {
     try
     {
         SplashView.CloseSplash(true);
         base.Shutdown();
     }
     catch (Exception e)
     {
         Dev2Logger.Warn(e.Message, GlobalConstants.WarewolfWarn);
     }
     ForceShutdown();
 }
Пример #14
0
        void ShowSplash()
        {
            // Create the window
            var repository = ServerRepository.Instance;
            var server     = repository.Source;

            server.ConnectAsync().Wait(3000);
            CustomContainer.Register(server);
            CustomContainer.Register(repository);

            var textToDisplay = Warewolf.Studio.Resources.Languages.Core.StandardStyling.Replace("\r\n", "") +
                                Warewolf.Studio.Resources.Languages.HelpText.WarewolfDefaultHelpDescription +
                                Warewolf.Studio.Resources.Languages.Core.StandardBodyParagraphClosing;

            CustomContainer.Register <IEventAggregator>(new EventAggregator());
            CustomContainer.Register <IPopupController>(new PopupController());
            CustomContainer.Register <IAsyncWorker>(new AsyncWorker());
            CustomContainer.Register <IExplorerTooltips>(new ExplorerTooltips());
            CustomContainer.Register <IWarewolfWebClient>(new WarewolfWebClient(new WebClient {
                Credentials = CredentialCache.DefaultCredentials
            }));
            CustomContainer.Register <IActivityParser>(new ActivityParser());
            CustomContainer.Register <IServiceDifferenceParser>(new ServiceDifferenceParser());

            var toolBoxViewModel = new ToolboxViewModel(new ToolboxModel(server, server, null), new ToolboxModel(server, server, null));

            CustomContainer.Register <IToolboxViewModel>(toolBoxViewModel);

            var helpViewModel = new HelpWindowViewModel(new HelpDescriptorViewModel(new HelpDescriptor("", textToDisplay, null)), new HelpModel(new EventAggregator()));

            CustomContainer.Register <IHelpWindowViewModel>(helpViewModel);

            CustomContainer.RegisterInstancePerRequestType <IRequestServiceNameView>(() => new RequestServiceNameView());
            CustomContainer.RegisterInstancePerRequestType <IJsonObjectsView>(() => new JsonObjectsView());
            CustomContainer.RegisterInstancePerRequestType <IChooseDLLView>(() => new ChooseDLLView());
            CustomContainer.RegisterInstancePerRequestType <IFileChooserView>(() => new FileChooserView());

            var splashViewModel = new SplashViewModel(server, new ExternalProcessExecutor());

            var splashPage = new SplashPage {
                DataContext = splashViewModel
            };

            SplashView = splashPage;
            // Show it
            SplashView.Show(false);

            _resetSplashCreated?.Set();
            splashViewModel.ShowServerStudioVersion();
            Dispatcher.Run();
        }
Пример #15
0
 private void SetupViews()
 {
     loadingView   = new LoadingView(GameObject.Find("Canvas/LoadingPanel"));
     mainView      = new MainMenuView(GameObject.Find("Canvas/MainMenuPanel"));
     splashView    = new SplashView(GameObject.Find("Canvas/SplashPanel"));
     mapEditorView = new MapEditorView(GameObject.Find("Canvas/MapEditorPanel"));
     gameView      = new GameView(GameObject.Find("Canvas/GamePanel"));
     //Hide all views
     loadingView.Hide();
     mainView.Hide();
     splashView.Hide();
     mapEditorView.Hide();
     gameView.Hide();
 }
Пример #16
0
        /// <summary>
        /// Displays the breensoft logo for a given amount of time
        /// and plays the logoIntro sound.
        /// </summary>
        /// <param name="time"></param>
        private void ShowSplashScreen()
        {
            SplashView splash = new SplashView();

            Recellection.CurrentState = splash;

            Cue intro = Sounds.Instance.LoadSound("logoIntro");

            intro.Play();
            while (intro.IsPlaying)
            {
                Thread.Sleep(10);
            }
        }
Пример #17
0
        public App()
        {
            InitializeComponent();
#if DEBUG
            HotReloader.Current.Run(this);
#endif
            Plugin.Iconize.Iconize
            .With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule())
            .With(new Plugin.Iconize.Fonts.MaterialDesignIconsModule());

            MainPage = new SplashView();
        }
Пример #18
0
        protected void InitializeShell(System.Windows.StartupEventArgs e)
        {
            _resetSplashCreated = new ManualResetEvent(false);

            _splashThread = new Thread(ShowSplash);
            _splashThread.SetApartmentState(ApartmentState.STA);
            _splashThread.IsBackground = true;
            _splashThread.Name         = "Splash Screen";
            _splashThread.Start();

            _resetSplashCreated.WaitOne();
            new Bootstrapper().Start();
            if (_hasDotNetFramweworkError)
            {
                SplashView.CloseSplash(false);
                var popupController = CustomContainer.Get <IPopupController>();
                popupController.ShowInstallationErrorOccurred();
                Shutdown();
            }
            base.OnStartup(e);
            _shellViewModel = MainWindow.DataContext as ShellViewModel;
            if (_shellViewModel != null)
            {
                CreateDummyWorkflowDesignerForCaching();
                SplashView.CloseSplash(false);

                if (e.Args.Length > 0)
                {
                    OpenBasedOnArguments(new WarwolfStartupEventArgs(e));
                }
                else
                {
                    _shellViewModel.ShowStartPageAsync();
                }
                CheckForDuplicateResources();
                _appExceptionHandler = new AppExceptionHandler(this, _shellViewModel);
                CustomContainer.Register <IApplicationAdaptor>(new ApplicationAdaptor(Current));
                CustomContainer.Register <IShellViewModel>(_shellViewModel);
            }
            var toolboxPane = Current.MainWindow.FindName("Toolbox") as ContentPane;

            toolboxPane?.Activate();
#if DEBUG
            SetAsStarted();
        }
Пример #19
0
        void splash_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            bool isVisibleNew = (bool)e.NewValue;
            bool isVisibleOld = (bool)e.OldValue;

            if (!isVisibleNew && isVisibleOld)
            {
                SplashView splash = sender as SplashView;
                if (splash != null)
                {
                    if (splash.SplashScreenDecision == SplashScreenDecision.TradingPost || splash.SplashScreenDecision == SplashScreenDecision.Gw2Spidy)
                    {
                        StartMain(splash.SplashScreenDecision == SplashScreenDecision.TradingPost);
                        splash.Close();
                    }
                }
            }
        }
Пример #20
0
        private async void CheckRequest()
        {
            try
            {
                var uri          = $"https://api.onfido.com/v2/applicants/{ApplicationId}/checks";
                var httpContents = new List <ParameterEntity>()
                {
                    new ParameterEntity
                    {
                        httpContent = new StringContent("standard"), Name = "\"type\""
                    },
                    new ParameterEntity
                    {
                        httpContent = new StringContent("identity"), Name = "\"reports[][name]\""
                    },
                    new ParameterEntity
                    {
                        httpContent = new StringContent("kyc"), Name = "\"reports[][variant]\""
                    }
                };

                var authorization = string.Format("Token token={0}", Token);
                var response      = Common.SendRequest(uri, httpContents, authorization, HttpMethod.Post);
                var msg           = string.Empty;
                if (response)
                {
                    msg = "Please wait until you receive our confirmation\nThank you. We will contact you soon";
                }
                else
                {
                    msg = "There was an error validating the data.\nPlease conctact the administrator";
                }

                await Application.Current.MainPage.DisplayAlert("Processing", msg, "Accept");

                var splashView = new SplashView();
                await Navigation.PushAsync(splashView);
            }
            catch (Exception ex)
            {
                return;
            }
        }
Пример #21
0
        protected override void OnExit(ExitEventArgs e)
        {
            SplashView.CloseSplash(true);

            // this is already handled ;)
            _shellViewModel?.PersistTabs(true);
            ProgressFileDownloader.PerformCleanup(new DirectoryWrapper(), GlobalConstants.VersionDownloadPath, new FileWrapper());
            HasShutdownStarted = true;
            DebugDispatcher.Instance.Shutdown();
            try
            {
                base.OnExit(e);
            }
            catch
            {
                // Best effort ;)
            }

            ForceShutdown();
        }
Пример #22
0
        public App()
        {
            InitializeComponent();

            MainPage = new SplashView();

            var dataService = new AzureDataService();

            dataService.Initialize()
            .ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    Debug.WriteLine("Faulted");
                }

                var categoriesPage  = new CategoriesView();
                NavigationPage root = new NavigationPage(categoriesPage);

                IFileHelper fileHelper   = DependencyService.Get <IFileHelper>();
                categoriesPage.ViewModel = new CategoriesViewModel(dataService, root.Navigation, fileHelper);
                MainPage = root;
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Пример #23
0
        public void Generate()
        {
            ThreadStart display = () =>
            {
                Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() =>
                {
                    SplashView view = this.container.Resolve <SplashView>();
                    this.eventAggregator.GetEvent <CloseSplashView>().Subscribe(x => view.Dispatcher.BeginInvoke((Action)view.Close), ThreadOption.PublisherThread, true);
                    view.Show();
                    this.waitOnCreation.Set();
                }));
                Dispatcher.Run();
            };

            Thread thread = new Thread(display)
            {
                Name = "Splash Screen Thread", IsBackground = true
            };

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();

            this.waitOnCreation.WaitOne();
        }
Пример #24
0
 public override void OnStop()
 {
     base.OnStop( );
     SplashView.Destroy( );
 }
Пример #25
0
 public static void SetSplashView(SplashView splashView)
 {
     _splashView = splashView;
     InitializeSplashWindow();
 }
Пример #26
0
 protected override void OnStart()
 {
     Task.Delay(3000);
     InitializeComponent();
     MainPage = new SplashView();
 }