private void _ShutdownErrorReporting()
        {
            // Remove event handlers first!
            AppDomain.CurrentDomain.UnhandledException -= _AppDomainUnhandledException;
            DispatcherUnhandledException          -= _DispatcherUnhandledException;
            TaskScheduler.UnobservedTaskException -= _TaskSchedulerUnobservedTaskException;

            if (_uploader != null)
            {
                if (_uploader.HasPendingWork)
                {
                    Splashscreen.ShowSplash("Waiting for uploader to finish ...");

                    string msg = "";
                    while (_uploader.HasPendingWork)
                    {
                        msg += ".";
                        Splashscreen.SetMessage(msg);
                        Thread.Sleep(250);
                    }

                    Splashscreen.HideSplash();
                }

                _uploader.Close();
            }
            _uploader = null;
        }
        private void _ReportException(object sender, Exception exc)
        {
            string msg = "Catched an unhandled exception raised from: " + sender.ToString();

            _logger.Error(msg, exc);

            // Try to close splash
            bool has_splash = Splashscreen.IsSplashAvail;

            try
            {
                if (has_splash)
                {
                    Splashscreen.HideSplash();
                }
            }
            catch { }

            // Not sure which state we're in, so better be careful with creating this dialog
            try
            {
                Dialogs.ErrorReportingDialog.Show(msg, exc);
                return;
            }
            catch { }

            // So showing error reporting dialog didn't work, uhhh ... last report: traditional message box
            msg += string.Format("\n\nThe latest log file located at\n\n{0}\n\nmight contain further details on its cause.\n", Settings.LOGPATH);
            MessageBox.Show(msg, "Fatal error occured", MessageBoxButton.OK, MessageBoxImage.Error);
        }
示例#3
0
        private static void Main()
        {
            var game = new GameObject("Horny Adventures");

            // build the startup menu scene

            OpenWorldScene _openWorldScene = new OpenWorldScene(game);

            _openWorldScene.Name = "OpenWorld";
            game.SceneManager.AddScene(_openWorldScene);

            Fightscene _fightscene = new Fightscene(game);

            _fightscene.Name = "fight";
            game.SceneManager.AddScene(_fightscene);

            Credits _creditsscreen = new Credits(game);

            _creditsscreen.Name = "credits";
            game.SceneManager.AddScene(_creditsscreen);

            Splashscreen _splashcreen = new Splashscreen(game);

            _splashcreen.Name = "splashscreen";
            game.SceneManager.AddScene(_splashcreen);

            Menu _menu = new Menu(game);

            _menu.Name = "menu";
            game.SceneManager.AddScene(_menu);
            //create here as many screens as we need but dont forget to make a class for each

            // Start the game
            game.SceneManager.StartScene("splashscreen"); //it is one of the above names, scene is called by its name!
        }
示例#4
0
        private void onFormLoad(object sender, EventArgs e)
        {
            //IEnumerator<Film> iFilms = BaseFilms.instance.GetFilmEnumerator(new Filtre());
            //_filtre.change = false;
            //
            //while (iFilms.MoveNext())
            //{
            //
            //}
            // Ajoute les films deja dans la base de donnees
            using (Splashscreen s = new Splashscreen())
            {
                s.Show();
                s.Update();
                _actionsDifferees = new ActionsDifferees(toolStripStatusLabel);

                // Etat des separateurs de fenetre
                splitContainer1.SplitterDistance = Configuration.splitter1Distance;
                splitContainer2.SplitterDistance = Configuration.splitter2Distance;
                toolStripMenuSelectionVus.setImages(new Image[] { Resources.threestate_undefined, Resources.threestate_unchecked, Resources.threestate_checked });
                toolStripMenuSelectionAVoir.setImages(new Image[] { Resources.threestate_undefined, Resources.threestate_checked, Resources.threestate_unchecked });
                toolStripMenuSelectionAlternatives.setImages(new Image[] { Resources.threestate_undefined, Resources.threestate_checked, Resources.threestate_unchecked });
                remplitListFilms();

                if (Configuration.relancerRechercheAuto)
                {
                    reprendTraitementFilms();
                }
                s.Close();
            }
        }
        public void Activate(IContext context, InstanceReference reference)
        {
            Type instanceType = reference.Instance.GetType();

            LOGGER.Info("Component activation: " + instanceType.Name);
            if (!instanceType.IsAssignableFrom(typeof(Splashscreen)))
            {
                Splashscreen splashscreen = App.Kernel.Get <Splashscreen>();
                splashscreen.SetProgress(string.Format("{0} loading...", instanceType.Name));
            }
        }
示例#6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            UpgradeSettings();

#if EPHEMERAL_SETTINGS
            AlbumArtDownloader.Properties.Settings.Default.Reset();
#endif

            AssignDefaultSettings();
            ApplyDefaultProxyCredentials();

            //Assign the application-wide GoToPage hyperlink handler
            System.Windows.Input.CommandManager.RegisterClassCommandBinding(typeof(Window), new System.Windows.Input.CommandBinding(System.Windows.Input.NavigationCommands.GoToPage, new System.Windows.Input.ExecutedRoutedEventHandler(GoToPageExec)));

            //Only shut down if the Exit button is pressed
            ShutdownMode = ShutdownMode.OnExplicitShutdown;
            if (!Splashscreen.ShowIfRequired())
            {
                //Splashscreen returned false, so exit
                Shutdown();
                return;
            }

            LoadScripts();             //TODO: Should this be done showing the splashscren? Faliures to load scripts could be shown in the details area...

            //Now shut down when all the windows are closed
            ShutdownMode = ShutdownMode.OnLastWindowClose;

            if (!ProcessCommandArgs(e.Args))
            {
                Shutdown();
                return;
            }

            string[] args;
            do
            {
                lock (mQueuedArgsLock)
                {
                    if (mQueuedArgs.Count == 0)
                    {
                        mQueuedArgs = null;
                        break;
                    }

                    args = mQueuedArgs.Dequeue();
                }
                ProcessCommandArgs(args);
            } while (true);             // Will break out when mQueuedArgs becomes empty
        }
示例#7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var splashScreen = new Splashscreen();

            this.MainWindow = splashScreen;
            splashScreen.Show();


            Task.Factory.StartNew(() =>
            {
                double prct = 0.9;
                int j       = 1;

                for (int i = 0; i <= 100; i++)
                {
                    prct = prct + (double)j * 0.1;
                    splashScreen.Dispatcher.Invoke(() => splashScreen.image.Opacity = prct);
                    if (prct == 1)
                    {
                        j = -1;
                    }
                    if (prct < 0.1)
                    {
                        j = 1;
                    }
                    System.Threading.Thread.Sleep(80);
                    i += 4;
                    splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i);
                }

                this.Dispatcher.Invoke(() =>
                {
                    var mainWindow  = new MainWindow();
                    this.MainWindow = mainWindow;
                    mainWindow.Show();
                    splashScreen.Close();
                });
            });
        }
        protected void _Init()
        {
            Splashscreen.SetMessage("Creating main window");

            // Load options
            // - Position window
            if (Config.Root.HasSection("window"))
            {
                if (Config.Root.window.HasItem("state") &&
                    Config.Root.window.state == WindowState.Maximized.ToString())
                {
                    WindowState = WindowState.Maximized;
                }
                else
                {
                    if (Config.Root.window.HasItem("pos_x") && Config.Root.window.pos_x != -1)
                    {
                        Left   = Config.Root.window.pos_x;
                        Top    = Config.Root.window.pos_y;
                        Width  = Config.Root.window.size_x;
                        Height = Config.Root.window.size_y;
                    }
                    else
                    {
                        WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    }
                }

                // - Position splitter
                if (Config.Root.window.HasItem("splitter"))
                {
                    if (Config.Root.window.splitter != -1)
                    {
                        MainGrid.ColumnDefinitions[0].Width = new GridLength(Config.Root.window.splitter);
                    }
                }
            }

#if !DEVENV
            if (Config.Root.HasSection("update_check") &&
                Config.Root.update_check.HasItem("check_for_updates") &&
                Config.Root.update_check.check_for_updates)
            {
                Splashscreen.SetMessage("Checking for updates");
                _RunUpdateChecker(true);
            }
#endif

            _SetupMRU();

            Splashscreen.SetMessage("Registering plugins");
            ActionFactory.AddToMenu(actions_menu, Actions_Click);

            _SetStatusbar();

            Details.Modified += Details_Modified;

            // Finally, update menu states
            _UpdateUIState();

            // Close splash
            Splashscreen.HideSplash();
        }
        // - Second, init remain based on actual config instance
        internal static void Init()
        {
            Splashscreen.ShowSplash("Starting up...");
            Application.Current.MainWindow = null;

            // Note version
            Log.Info("{0}, version {1}", APPNAME, APPVERSION);


            if (!Config.Root.HasSection("core"))
            {
                Config.Root.AddSection("core");
            }


            // Pick suitable default language if setting is missing
            Splashscreen.SetMessage("Setting up language");
            if (!Config.Root.core.HasItem("language"))
            {
                Config.Root.core.AddItem("language");
            }
            if (string.IsNullOrEmpty(Config.Root.core.language))
            {
                Config.Root.core.language = Thread.CurrentThread.CurrentUICulture.Name;
            }
            if (!LanguageHandler.LANG.LanguagesAvail.ToList().Contains(Config.Root.core.language))
            {
                Config.Root.core.language = "en-US";                //Fallback to a language known
            }
            // Setup actual language for translations
            Splashscreen.SetMessage("Loading language resources");
            LANGUAGE = Config.Root.core.language;
            LanguageHandler.LANG.SelectLanguage(LANGUAGE);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(LANGUAGE);


            // Create defaultpath setting if not set up yet
            Splashscreen.SetMessage("Setting up default savegame path");
            if (!Config.Root.core.HasItem("defaultpath"))
            {
                Config.Root.core.AddItem("defaultpath");
            }
            if (string.IsNullOrEmpty(Config.Root.core.defaultpath) || !Directory.Exists(Config.Root.core.defaultpath))
            {
                string subpath = Path.Combine("FactoryGame", "Saved", "SaveGames");

                string path = Environment.GetEnvironmentVariable("LOCALAPPDATA");
                if (path != null)
                {
                    path = Path.Combine(path, subpath);
                    if (!Directory.Exists(path))
                    {
                        path = null;
                    }
                }

                if (path == null)
                {
                    path = Environment.GetEnvironmentVariable("APPDATA");
                    if (path != null)
                    {
                        path = Path.Combine(path, "..", subpath);
                        if (!Directory.Exists(path))
                        {
                            path = null;
                        }
                    }
                }

                if (path == null)
                {
                    path = Environment.GetEnvironmentVariable("USERPROFILE");
                    if (path != null)
                    {
                        path = Path.Combine(path, "ApplicationData", "Local", subpath);
                        if (!Directory.Exists(path))
                        {
                            path = null;
                        }
                    }
                }

                Config.Root.core.defaultpath = path;
            }


            // Read user id from registry, resp. create one if none was found in registry
            string id = null;

            try
            {
                using (RegistryKey key = Helpers.OpenRegKey(Registry.CurrentUser,
                                                            "SOFTWARE/Epic Games/Unreal Engine/Identifiers"))
                {
                    if (key != null)
                    {
                        id = key.GetValue("AccountId") as string;
                    }
                }
            }
            catch { }
            if (id == null)
            {
                id = Environment.UserName + Environment.MachineName;
            }
            if (id != null)
            {
                // Create anonymous id on info found
                using (SHA256 sha = SHA256.Create())
                {
                    byte[] arr = Encoding.ASCII.GetBytes(id);
                    USER_KEY = sha.ComputeHash(arr);
                    USER_ID  = BitConverter.ToString(USER_KEY).Replace("-", "");
                }
            }


            // Setup export path
            if (!Config.Root.core.HasItem("exportpath"))
            {
                Config.Root.core.AddItem("exportpath", "");
            }
            if (string.IsNullOrEmpty(Config.Root.core.exportpath) || !Directory.Exists(Config.Root.core.exportpath))
            {
                Config.Root.core.exportpath = Path.Combine(APPPATH, EXPORTS);
            }
            EXPORTPATH = Config.Root.core.exportpath;


            // Create any missing config before continuing
            if (!Config.Root.HasSection("update_check"))
            {
                Config.Root.AddSection("update_check");
            }
            if (!Config.Root.update_check.HasItem("check_for_updates"))
            {
                Config.Root.update_check.AddItem("check_for_updates", true);
            }

            if (!Config.Root.HasSection("deep_analysis"))
            {
                Config.Root.AddSection("deep_analysis");
            }
            if (!Config.Root.deep_analysis.HasItem("enabled"))
            {
                Config.Root.deep_analysis.AddItem("enabled", false);
            }

            if (!Config.Root.HasSection("crash_reports"))
            {
                Config.Root.AddSection("crash_reports");
            }
            if (!Config.Root.crash_reports.HasItem("enabled"))
            {
                Config.Root.crash_reports.AddItem("enabled", false);
            }

            if (!Config.Root.HasSection("incident_reports"))
            {
                Config.Root.AddSection("incident_reports");
            }
            if (!Config.Root.incident_reports.HasItem("enabled"))
            {
                Config.Root.incident_reports.AddItem("enabled", false);
            }

            if (!Config.Root.HasSection("online_mapping"))
            {
                Config.Root.AddSection("online_mapping");
            }
            if (!Config.Root.online_mapping.HasItem("enabled"))
            {
                Config.Root.online_mapping.AddItem("enabled", false);
            }
        }
示例#10
0
 public LoginWebViewClient(Splashscreen splash)
 {
     this.splash = splash;
 }
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     Splashscreen.Begin();
     Splashscreen.Completed += new EventHandler(SplashScreenComplete);
 }
示例#12
0
        public App()
        {
            InitializeComponent();

            MainPage = new Splashscreen();
        }
 public static void ShowSplashScreen()
 {
     splashscreen = new Splashscreen();
     splashscreen.Show();
 }
示例#14
0
        public void SplashscreenStart()
        {
            var screen = new Splashscreen();

            Application.Run(screen);
        }
示例#15
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="daddy">Reference to main window (MainWindow instance), used for callback purposes</param>
        public AboutBox(MainWindow daddy)
        {
            _daddy = daddy;


            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            InitializeComponent();

            bool   bExtra = false;
            String splash = Splashscreen.GetSplashScreen(out bExtra);

            if (File.Exists(splash))
            {
                try
                {
                    pictureBox1.Image = Image.FromFile(splash);
                }
                catch (Exception)
                {
                }
            }

            this.Text         = String.Format("About {0}", AssemblyTitle);
            lblExtraInfo.Text = "";

            String ver = AssemblyVersion;

            if (MainWindow.AssemblySubVersion != "")
            {
                ver += "." + MainWindow.AssemblySubVersion;
                lblExtraInfo.Text = "Build " + _daddy.GetBuildTime() + " ";
            }
            else
            {
                String prefix = ".0";
                while (ver.EndsWith(prefix))
                {
                    ver = ver.Substring(0, ver.LastIndexOf(prefix));
                }
            }
            String dotnet = MyTools.GetHighestInstalledFramework();

            if (dotnet != "")
            {
                lblExtraInfo.Text += ".Net " + MyTools.GetHighestInstalledFramework();
            }

            this.labelVersion.Text   = String.Format("Version {0}", ver);
            this.labelCopyright.Text = AssemblyCopyright;
            this.label5.Text         = AssemblyDescription;

            try
            {
                txtAssemblies.Text = MyTools.GetOSAssembliesFrameworkInfo();
            }
            catch (Exception ex)
            {
                txtAssemblies.Text = ex.Message;
            }

            MakeTransparentControl(labelVersion, bExtra);
            MakeTransparentControl(labelCopyright, bExtra);
            MakeTransparentControl(label5, bExtra);
            MakeTransparentControl(linkLabel1, bExtra);
            MakeTransparentControl(linkLabel2, bExtra);
            MakeTransparentControl(linkLabel3, bExtra);
            MakeTransparentControl(linkLabel4, bExtra);
            MakeTransparentControl(linkLabel5, bExtra);
            MakeTransparentControl(label1, bExtra);
            MakeTransparentControl(label2, bExtra);
            MakeTransparentControl(label3, bExtra);
            MakeTransparentControl(label4, bExtra);
            MakeTransparentControl(lblExtraInfo, bExtra);
            MakeTransparentControl(lockPictureBox, bExtra);
            //MakeTransparentControl(txtAssemblies, bExtra);

            // Le lock / unlock ?
            if (SpecialFeatures.SpecialFeaturesMgt.AreSpecialFeaturesEnabled())
            {
                // unlock
                lockPictureBox.Image = _daddy.GetImageSized("Lock-Unlock-icon");
            }
            else
            {
                // lock
                lockPictureBox.Image = _daddy.GetImageSized("Lock-Lock-icon");
            }
        }