예제 #1
0
 private static void PerformRegistryOperation(string languagePackType, string culture, GrayException.UserCodeDelegate function)
 {
     try
     {
         function();
     }
     catch (SecurityException innerException)
     {
         string regKeyPath = UmLanguagePack.GetRegKeyPath(true, languagePackType);
         throw new RegistryInsufficientPermissionException(regKeyPath, culture, innerException);
     }
 }
예제 #2
0
        private void DeleteRegKeyAndValue(string key, string value)
        {
            string regKeyPath = UmLanguagePack.GetRegKeyPath(false, key);
            bool   flag;

            using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(regKeyPath, true))
            {
                registryKey.DeleteValue(value, false);
                string[] valueNames = registryKey.GetValueNames();
                flag = (valueNames.Length > 0);
            }
            if (!flag)
            {
                using (RegistryKey registryKey2 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\UnifiedMessagingRole", true))
                {
                    registryKey2.DeleteSubKey(key);
                }
            }
        }
예제 #3
0
        private void AddRegKeyValue(string languagePackType, string culture, Guid productCode)
        {
            string regKeyPath = UmLanguagePack.GetRegKeyPath(true, languagePackType);

            Registry.SetValue(regKeyPath, culture, productCode.ToString(), RegistryValueKind.String);
        }