Example #1
0
        public void SetWarningBool(VisualGitWarningBool visualGitWarningBool, bool value)
        {
            using (RegistryKey rk = OpenHKCUKey("Warnings\\Bools"))
            {
                if (rk == null)
                    return;

                if (value)
                    rk.SetValue(visualGitWarningBool.ToString(), 1);
                else
                    rk.DeleteValue(visualGitWarningBool.ToString());
            }
        }
Example #2
0
        public bool GetWarningBool(VisualGitWarningBool visualGitWarningBool)
        {
            using (RegistryKey rk = OpenHKCUKey("Warnings\\Bools"))
            {
                if (rk == null)
                    return false;

                object v = rk.GetValue(visualGitWarningBool.ToString());

                if (!(v is int))
                    return false;

                return ((int)v) != 0;
            }
        }