예제 #1
0
		public RenameRegistryKeyAction(ActionRenameRegistryKey actionItem, ContextEnum context)
		{
			try
			{
				if (string.IsNullOrEmpty(actionItem.Path) ||
					string.IsNullOrEmpty(actionItem.KeyName) ||
					string.IsNullOrEmpty(actionItem.NewKeyName))

				{
					return;	
				}

				Hive = StaticShared.TranslateContextToRegistryHive(context);
				Path = StaticShared.GetVersionedString(StaticShared.ResolveSoftware6432Root(actionItem.Path, context));
				KeyName = actionItem.KeyName;
				NewKeyName = actionItem.NewKeyName;
			}
			catch (Exception ex)
			{
				Logger.LogError(ex, "Exception in setting RenameRegistryKeyAction members.");
			}
		}
예제 #2
0
		public void TestRenameRegistryKeyActionUser()
		{
			ActionRenameRegistryKey actionItem = new ActionRenameRegistryKey();
			actionItem.Path = @"${Software6432}\Workshare\Options\${Version}\Internal\Internal\DocumentProviders";
			actionItem.KeyName = "Interwoven 8";
			actionItem.NewKeyName = "Interwoven";

			RenameRegistryKeyAction action = new RenameRegistryKeyAction(actionItem, ContextEnum.User);
			action.Execute();

		}