Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            this.DispatcherUnhandledException          += App_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            AppDomain.CurrentDomain.AssemblyResolve    += CurrentDomain_AssemblyResolve;

            if (IsAlreadyRunning())
            {
                MessageBox.Show("YtoX is already running.");
                Application.Current.Shutdown();
                return;
            }

            ShellHelper.InstallShortcut();
            SystemHelper.SetNativeDllPath();
            SystemHelper.RegisterComDll();
            SystemHelper.SetLoadOnStartup();
            TaskBarHelper.Setup();

            if (!DAC.SetupDB())
            {
                MessageBox.Show("Database not found.", Constants.APP_ID, MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Shutdown();
                return;
            }

            Repository.Read();
            SettingsHelper.Load();
            Engine.Instance.Start();
            TaskBarHelper.ShowBalloonTip("YtoX Engine Started!\nPlease make sure you have configured the settings.");

            base.OnStartup(e);
        }
Пример #2
0
 private void TaskBarButton_Click(object sender, RoutedEventArgs e)
 {
     TaskBarHelper.Setup();
 }