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

            // The boostrapper will create the Shell instance, so the App.xaml does not have a StartupUri.
            QuickStartBootstrapper bootstrapper = new QuickStartBootstrapper();
            bootstrapper.Run();
        }
Example #2
0
        //private static readonly ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        //private static MainWindow app;

        //private void Application_Startup(object sender, StartupEventArgs e)
        //{
        //    Log.Info("Application Startup");

        //    // For catching Global uncaught exception
        //    AppDomain currentDomain = AppDomain.CurrentDomain;
        //    currentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionOccured);

        //    Log.Info("Starting App");
        //    LogMachineDetails();
        //    app = new MainWindow();
        //    var context = new MainViewModel();
        //    app.DataContext = context;
        //    app.Show();

        //    if (e.Args.Length == 1) //make sure an argument is passed
        //    {
        //        Log.Info("File type association: " + e.Args[0]);
        //        FileInfo file = new FileInfo(e.Args[0]);
        //        if (file.Exists) //make sure it's actually a file
        //        {
        //            // Here, add you own code
        //            // ((MainViewModel)app.DataContext).OpenFile(file.FullName);
        //        }
        //    }
        //}

        //static void UnhandledExceptionOccured(object sender, UnhandledExceptionEventArgs args)
        //{
        //    // Here change path to the log.txt file
        //    var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
        //                                            + "\\Administrator\\ModularityWithMef.Desktop\\log.txt";

        //    // Show a message before closing application
        //    var dialogService = new MvvmDialogs.DialogService();
        //    dialogService.ShowMessageBox((INotifyPropertyChanged)(app.DataContext),
        //        "Oops, something went wrong and the application must close. Please find a " +
        //        "report on the issue at: " + path + Environment.NewLine +
        //        "If the problem persist, please contact Administrator.",
        //        "Unhandled Error",
        //        MessageBoxButton.OK);

        //    Exception e = (Exception)args.ExceptionObject;
        //    Log.Fatal("Application has crashed", e);
        //}

        //private void LogMachineDetails()
        //{
        //    var computer = new Microsoft.VisualBasic.Devices.ComputerInfo();

        //    string text = "OS: " + computer.OSPlatform + " v" + computer.OSVersion + Environment.NewLine +
        //                  computer.OSFullName + Environment.NewLine +
        //                  "RAM: " + computer.TotalPhysicalMemory.ToString() + Environment.NewLine +
        //                  "Language: " + computer.InstalledUICulture.EnglishName;
        //    Log.Info(text);
        //}
        #endregion

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bootstrapper = new QuickStartBootstrapper();

            bootstrapper.Run();
        }
Example #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // The boostrapper will create the Shell instance, so the App.xaml does not have a StartupUri.
            QuickStartBootstrapper bootstrapper = new QuickStartBootstrapper();

            bootstrapper.Run();
        }