Exemple #1
0
		public void TestUpdateOptionValueActionUser()
		{
			OptionApi.SetString("DefaultDocumentProvider", "Interwoven 8");
			
			ActionUpdateOptionValue actionItem = new ActionUpdateOptionValue();
			actionItem.Name = "DefaultDocumentProvider";
			actionItem.Type = "string";
			actionItem.Value = "Interwoven 8";
			actionItem.NewValue = "Interwoven";

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

			string value = OptionApi.GetString("DefaultDocumentProvider");
			
			Assert.IsTrue(string.Compare(value.ToLower(), "interwoven") == 0);
		}
Exemple #2
0
		private void ExcecuteUpdateOptionValueAction(Action action, ContextEnum context)
		{
			try
			{
				if (action == null ||
					action.UpdateOptionValue == null)
				{
					return;
				}

				foreach (ActionUpdateOptionValue actionItem in action.UpdateOptionValue)
				{
					if (actionItem == null)
					{
						return;
					}

					UpdateOptionValueAction updateOptionValue = new UpdateOptionValueAction(actionItem, context);
					updateOptionValue.Execute();
				}
			}
			catch (Exception ex)
			{
				Logger.LogError(ex);
			}
		}