コード例 #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
ファイル: TestActions.cs プロジェクト: killbug2004/WSProf
		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();

		}