Beispiel #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

#if !DEBUG
            Current.DispatcherUnhandledException += (o, args) =>
            {
                MetroException.Show(args.Exception);

                args.Handled = true;
            };
#endif
            // Reset Directory
            System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));

            // Load version info
            VersionInfo.Load("version.json");

            // Create Assembly Storage
            AssemblyStorage = new Storage();

            // Update Assembly Protocol
            AssemblyProtocol.UpdateProtocol();

            // Create jumplist
            JumpLists.UpdateJumplists();

            // Create XBDM Instance
            AssemblyStorage.AssemblySettings.Xbdm = new Xbdm(AssemblyStorage.AssemblySettings.XdkNameIp);

            // Try and delete all temp data
            VariousFunctions.EmptyUpdaterLocations();

            // Dubs, checkem
            _0xabad1dea.CheckServerStatus();

            // Update File Defaults
            FileDefaults.UpdateFileDefaults();

            // Set closing method
            Current.Exit += (o, args) =>
            {
                // Update Settings with Window Width/Height
                AssemblyStorage.AssemblySettings.ApplicationSizeMaximize =
                    (AssemblyStorage.AssemblySettings.HomeWindow.WindowState == WindowState.Maximized);
                if (AssemblyStorage.AssemblySettings.ApplicationSizeMaximize)
                {
                    return;
                }

                AssemblyStorage.AssemblySettings.ApplicationSizeWidth  = AssemblyStorage.AssemblySettings.HomeWindow.Width;
                AssemblyStorage.AssemblySettings.ApplicationSizeHeight = AssemblyStorage.AssemblySettings.HomeWindow.Height;
            };
        }
Beispiel #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Snazzy exception dialog
            Current.DispatcherUnhandledException += (o, args) =>
            {
                MetroException.Show(args.Exception);

                args.Handled = true;
            };

            // Create Assembly Storage
            MetroIdeStorage = new Storage();

            // Create jumplist
            JumpLists.UpdateJumplists();

            // Try and delete all temp data
            VariousFunctions.EmptyUpdaterLocations();

            // Update File Defaults
            FileDefaults.UpdateFileDefaults();

            // Set closing method
            Current.Exit += (o, args) =>
            {
                // Update Settings with Window Width/Height
                MetroIdeStorage.MetroIdeSettings.ApplicationSizeMaximize =
                    (MetroIdeStorage.MetroIdeSettings.HomeWindow.WindowState == WindowState.Maximized);
                if (MetroIdeStorage.MetroIdeSettings.ApplicationSizeMaximize)
                {
                    return;
                }

                MetroIdeStorage.MetroIdeSettings.ApplicationSizeWidth =
                    MetroIdeStorage.MetroIdeSettings.HomeWindow.Width;
                MetroIdeStorage.MetroIdeSettings.ApplicationSizeHeight =
                    MetroIdeStorage.MetroIdeSettings.HomeWindow.Height;
            };
        }