Esempio n. 1
0
        private static bool ReadBoolRegKey(string key, bool defaultValue)
        {
            object obj = VersionIndependentRegKey.GetValue(key);

            if (!(obj is string))
            {
                obj = null;
            }
            if (obj == null)
            {
                return(defaultValue);
            }
            return(((string)obj).Equals("true", StringComparison.CurrentCultureIgnoreCase));
        }
Esempio n. 2
0
        public static string GetInstallDir()
        {
#if DEBUG
#if INSTALL_DIR_FROM_REG
            VersionIndependentRegKey.GetValue("InstallDir", string.Empty);
#else
            string gitExtDir = GetGitExtensionsDirectory().TrimEnd('\\').TrimEnd('/');
            string debugPath = @"GitExtensions\bin\Debug";
            int    len       = debugPath.Length;
            var    path      = gitExtDir.Substring(gitExtDir.Length - len);
            if (debugPath.Replace('\\', '/').Equals(path.Replace('\\', '/')))
            {
                string projectPath = gitExtDir.Substring(0, len + 2);
                return(Path.Combine(projectPath, "Bin"));
            }
#endif
#endif

            return(GetGitExtensionsDirectory());
        }
Esempio n. 3
0
 private static string ReadStringRegValue(string key, string defaultValue)
 {
     return((string)VersionIndependentRegKey.GetValue(key, defaultValue));
 }