コード例 #1
0
ファイル: App.xaml.cs プロジェクト: flamestream/taction
        protected override void OnStartup(StartupEventArgs ev)
        {
            base.OnStartup(ev);

            // Only exit application when on explicit endpoint
            Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;

            // Ensure app data directory
            Directory.CreateDirectory(AppDataDir);
            Directory.CreateDirectory(FontDir);

            // Initialize basic stuff
            GlobalMouseHook  = new GlobalMouseHook();
            InputSimulator   = new InputSimulatorHelper();
            Config           = new Config();
            ErrorLogger      = new ErrorLogger(ErrorFilePath, MaxErrorLogSize, ErrorLogTrimLineCount);
            UpdateChecker    = new UpdateChecker(ReleaseApi);
            NotificationIcon = new NotificationIcon();

            // Setup Updater
            UpdateChecker.OnUpdateAvailable += UpdateChecker_OnUpdateAvailable;

            Config.LoadState();
            LoadSavedLayout(true);

            MainWindow = new MainPanel();
            MainWindow.Show();

            CheckForUpdates();
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: flamestream/taction
 protected override void OnExit(ExitEventArgs e)
 {
     InputSimulator.ReleaseAllKeys();
     GlobalMouseHook.Dispose();
     NotificationIcon.Dispose();
 }
コード例 #3
0
ファイル: App.Api.cs プロジェクト: flamestream/taction
 public void Disable()
 {
     MainPanel.Visibility = Visibility.Hidden;
     GlobalMouseHook.Disable();
 }