示例#1
0
        private void AboutForm_Load(object sender, EventArgs e)
        {
            var version = new Version(Assembly.GetExecutingAssembly().GetCustomAttribute <AssemblyFileVersionAttribute>().Version);
            var title   = Assembly.GetExecutingAssembly().GetCustomAttribute <AssemblyTitleAttribute>().Title;

            versionLabel.Text = $"v{version.ToString(3)}";
            titleLabel.Text   = title;

            runOnStartupCheckBox.Checked = StartupHelper.IsRegisteredToRunAtStartup();

            GoogleAnalyticsHelper.TrackPage("AboutForm");
        }
示例#2
0
 private void runOnStartupCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     if (runOnStartupCheckBox.Checked)
     {
         GoogleAnalyticsHelper.TrackEvent("Settings", "Startup", "Enabled");
         StartupHelper.AddToStartup();
     }
     else
     {
         GoogleAnalyticsHelper.TrackEvent("Settings", "Startup", "Disabled");
         StartupHelper.RemoveFromStartup();
     }
 }
 private void TabletModeHelper_TabletModeChanged(object sender, bool isTabletMode)
 {
     this.Invoke(new MethodInvoker(() =>
     {
         try
         {
             TabletModeChanged(isTabletMode);
             GoogleAnalyticsHelper.TrackEvent("UsageMode", isTabletMode ? "Tablet" : "Desktop");
         }
         catch (Exception ex)
         {
             Debug.WriteLine("Exception in TabletModeHelper_TabletModeChanged: " + ex.ToString());
         }
     }));
 }
 internal static void ProcessSquirrelEvents()
 {
     try
     {
         using (var mgr = new UpdateManager(releasesPath))
         {
             // Note, in most of these scenarios, the app exits after this method
             // completes!
             SquirrelAwareApp.HandleEvents(
                 onInitialInstall: v =>
             {
                 mgr.CreateOnlyStartMenuShortcutForThisExe();
             },
                 onAppUpdate: v =>
             {
                 if (StartupHelper.IsRegisteredToRunAtStartup())
                 {
                     StartupHelper.AddToStartup();     // Fix executable path change
                 }
                 mgr.CreateOnlyStartMenuShortcutForThisExe();
             },
                 onAppUninstall: v =>
             {
                 StartupHelper.RemoveFromStartup();
                 mgr.RemoveOnlyStartMenuShortcutForThisExe();
             },
                 onFirstRun: () =>
             {
                 GoogleAnalyticsHelper.TrackPage("Installed");
                 StartupHelper.AddToStartup();
             });
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine("ProcessSquirrelEvents failed: " + ex.ToString());
     }
 }
        private void DockForm_Load(object sender, EventArgs e)
        {
            keyboardStateCheckTimer.Enabled = true;
            notifyIcon.Visible = true;

            var windowsVersion = Environment.OSVersion.Version;

            if (windowsVersion < Version.Parse("10.0.16299.0"))
            {
                GoogleAnalyticsHelper.TrackEvent("InstalledOnUnsupportedOS", windowsVersion.ToString());
                MessageBox.Show("Touch Keyboard Focus Fix only works on Windows 10 v1709 (Fall Creators Update) and above.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ExitProgram();
            }

            SquirrelHelper.CheckForUpdates();

            var appVersion = new Version(Assembly.GetExecutingAssembly().GetCustomAttribute <AssemblyFileVersionAttribute>().Version);

            GoogleAnalyticsHelper.TrackPage("DockForm");
            GoogleAnalyticsHelper.TrackEvent("OSVersion", windowsVersion.ToString());
            GoogleAnalyticsHelper.TrackEvent("AppStarted", appVersion.ToString());
            GoogleAnalyticsHelper.TrackEvent("UsageMode", TabletModeHelper.IsTabletMode ? "Tablet" : "Desktop");
        }
示例#6
0
 private void githubLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     GoogleAnalyticsHelper.TrackEvent("About", "LinkClicked", "Github");
     Process.Start("https://github.com/MahdiGhiasi/Windows10TouchKeyboardFocusFix");
 }