Example #1
0
        public bool UpdateStatus(SpecFlowInstallationStatus status)
        {
            using (var key = Registry.CurrentUser.CreateSubKey(RegPath, RegistryKeyPermissionCheck.ReadWriteSubTree))
            {
                if (key == null)
                {
                    return(false);
                }

                if (status.InstalledVersion != null)
                {
                    key.SetValue("version", status.InstalledVersion);
                }
                if (status.InstallDate != null)
                {
                    key.SetValue("installDate", SerializeDate(status.InstallDate));
                }
                if (status.LastUsedDate != null)
                {
                    key.SetValue("lastUsedDate", SerializeDate(status.LastUsedDate));
                }
                key.SetValue("usageDays", status.UsageDays);
                key.SetValue("userLevel", status.UserLevel);
            }
            return(true);
        }
Example #2
0
        public SpecFlowInstallationStatus GetInstallStatus()
        {
            var status = new SpecFlowInstallationStatus();

            using (var key = Registry.CurrentUser.OpenSubKey(RegPath, RegistryKeyPermissionCheck.ReadSubTree))
            {
                if (key == null)
                {
                    return(status);
                }

                status.InstalledVersion = ReadStringValue(key, "version", s => new Version(s));
                status.InstallDate      = ReadIntValue(key, "installDate", DeserializeDate);
                status.LastUsedDate     = ReadIntValue(key, "lastUsedDate", DeserializeDate);
                status.UsageDays        = ReadIntValue(key, "usageDays", i => i);
                status.UserLevel        = ReadIntValue(key, "userLevel", i => i);
            }

            return(status);
        }
Example #3
0
 private void UpdateStatus(SpecFlowInstallationStatus status)
 {
     statusAccessor.UpdateStatus(status);
 }
 private void UpdateStatus(SpecFlowInstallationStatus status)
 {
     statusAccessor.UpdateStatus(status);
 }