Example #1
0
        void OnStartWithWindowsChanged()
        {
            RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            if (StartWithWindows)
            {
                if (rkApp.GetValue(registryValueName) != null)
                {
                    return;
                }
                var config   = ConfigSerializer.GetConfig();
                var launcher = Path.Combine(ConfigSerializer.SettingsPath, "DXVcs2Git.Launcher.exe");
                if (File.Exists(launcher))
                {
                    rkApp.SetValue("DXVcs2Git", String.Format("\"{0}\" -h", launcher));
                }
            }
            else
            {
                if (rkApp.GetValue(registryValueName) == null)
                {
                    return;
                }
                rkApp.DeleteValue(registryValueName);
            }
        }
Example #2
0
 public RootViewModel()
 {
     Config = ConfigSerializer.GetConfig();
     UpdateAppearance();
     dispatcher = Dispatcher.CurrentDispatcher;
     FarmIntegrator.Start(FarmRefreshed);
     UpdateCommand      = DelegateCommandFactory.Create(PerformUpdate, CanPerformUpdate);
     SettingsCommand    = DelegateCommandFactory.Create(ShowSettings, CanShowSettings);
     ShowLogCommand     = DelegateCommandFactory.Create(PerformShowLog);
     LoadTestLogCommand = DelegateCommandFactory.Create(PerformLoadTestLog, CanPerformLoadTestLog);
     InitializeCommand  = DelegateCommandFactory.Create(PerformInitialize, CanPerformInitialize);
     ActivateCommand    = DelegateCommandFactory.Create(PerformActivate, CanPerformActivate);
     LogViewModel       = new LoggingViewModel();
     Version            = $"Git tools {VersionInfo.Version}";
 }
Example #3
0
        static int Main(string[] args)
        {
            LogifyClient logifyClient = new LogifyClient();

            logifyClient.ApiKey = "9F13F4F0568643A3BCAE34E9B0C4A1B1";
            logifyClient.Run();
            logifyClient.ConfirmSendReport = true;
            const string UIProcessName    = "DXVcs2Git.UI";
            const string UIExecutableName = UIProcessName + ".exe";
            var          options          = Parser.Default.ParseArguments <CommandLineOptions>(args);
            var          delay            = options.MapResult(x => x.WaitForExit, x => 0);

            do
            {
                if (delay == 0)
                {
                    break;
                }
                Process uiProcess = Process.GetProcessesByName(UIProcessName).FirstOrDefault();
                if (uiProcess == null)
                {
                    break;
                }
                if (!uiProcess.WaitForExit(delay))
                {
                    return((int)ExitCodes.WaitTimeout);
                }
            } while (false);
            var installPath    = ConfigSerializer.GetConfig().InstallPath;
            var uiFileFullName = Path.Combine(installPath, UIExecutableName);

            if (!File.Exists(uiFileFullName))
            {
                return((int)ExitCodes.UIFileNotExist);
            }
            string str = "";

            foreach (var arg in args)
            {
                str += arg + " ";
            }
            Process.Start(new ProcessStartInfo(uiFileFullName)
            {
                UseShellExecute = true, Arguments = str
            });
            logifyClient.Stop();
            return((int)ExitCodes.Success);
        }
Example #4
0
 protected override void OnAttached()
 {
     base.OnAttached();
     AssociatedObject.EditValue       = ConfigSerializer.GetConfig().KeyGesture;
     AssociatedObject.PreviewKeyDown += OnPreviewKeyDown;
 }
Example #5
0
 public static void Initialize()
 {
     RegisterHotKey(ConfigSerializer.GetConfig().KeyGesture);
 }