public UpdateActionDescriptor(HttpControllerDescriptor controllerDescriptor, MethodInfo method, Type entityType, ChangeOperation operationType)
     : base(controllerDescriptor, method)
 {
     _entityType = entityType;
     _changeOperation = operationType;
     _method = method;
 }
 public UpdateActionDescriptor GetUpdateAction(Type entityType, ChangeOperation operationType)
 {
     return _updateActions.FirstOrDefault(p => (p.EntityType == entityType) && (p.ChangeOperation == operationType));
 }
			public ChangeEvent(BaseItem item, ChangeOperation op)
			{
				this.item = item;
				this.operation = op;
			}
		private static void InternalSerialize(XmlDictionaryWriter writer, ChangeOperation ChangeOperation, string ns, string property, object value)
		{
			string str = writer.LookupPrefix(ns);
			writer.LookupPrefix("http://schemas.microsoft.com/2008/1/ActiveDirectory");
			if (ChangeOperation != ChangeOperation.None)
			{
				writer.WriteStartElement("Change", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess");
				ChangeOperation changeOperation = ChangeOperation;
				switch (changeOperation)
				{
					case ChangeOperation.Add:
					{
						writer.WriteAttributeString("Operation", "add");
						break;
					}
					case ChangeOperation.Delete:
					{
						writer.WriteAttributeString("Operation", "delete");
						break;
					}
					case ChangeOperation.Replace:
					{
						writer.WriteAttributeString("Operation", "replace");
						break;
					}
				}
			}
			else
			{
				writer.WriteStartElement("AttributeTypeAndValue", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess");
			}
			writer.WriteElementString("AttributeType", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess", AttributeTypeAndValueSerializer.FormatAttributeName(str, property));
			if (value != null)
			{
				if (value as ICollection == null)
				{
					writer.WriteStartElement("AttributeValue", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess");
					if (value as DirectoryAttributeModification == null)
					{
						ADValueSerializer.Serialize(writer, value);
					}
					else
					{
						DirectoryAttributeModification directoryAttributeModification = (DirectoryAttributeModification)value;
						ADValueSerializer.Serialize(writer, directoryAttributeModification[0]);
					}
					writer.WriteEndElement();
				}
				else
				{
					ICollection collections = (ICollection)value;
					if (collections.Count > 0)
					{
						writer.WriteStartElement("AttributeValue", "http://schemas.microsoft.com/2006/11/IdentityManagement/DirectoryAccess");
						foreach (object obj in collections)
						{
							ADValueSerializer.Serialize(writer, obj);
						}
						writer.WriteEndElement();
					}
				}
			}
			writer.WriteEndElement();
		}
		public static void Serialize(XmlDictionaryWriter writer, ChangeOperation ChangeOperation, DirectoryAttributeModification attribute)
		{
			AttributeTypeAndValueSerializer.InternalSerialize(writer, ChangeOperation, AttributeNs.LookupNs(attribute.Name, SyntheticAttributeOperation.Write), attribute.Name, attribute);
		}
		public static void Serialize(XmlDictionaryWriter writer, ChangeOperation ChangeOperation, string ns, string property, object value)
		{
			AttributeTypeAndValueSerializer.InternalSerialize(writer, ChangeOperation, ns, property, value);
		}
 /// <summary>
 /// Searches the current page of change entries for the type of object and operation changed and the modifier involved.
 /// </summary>
 /// <param name="operation">The change operation being sought.</param>
 /// <param name="objectType">The change object type being sought.</param>
 /// <param name="modifier">The change object modifier involved being sought.</param>
 /// <returns>
 /// The first <see cref="ChangeEntry" /> matching the search conditions.
 /// </returns>
 public ChangeEntry FindChange(ChangeOperation operation, ChangeObjectType objectType, ChangeObjectModifier? modifier)
 {
     List<ChangeEntry> changes = FindChanges(operation, objectType, modifier);
     return changes.Count > 0 ? changes.First() : null;
 }
 /// <summary>
 /// Searches the current page of change entries for the type of object and operation changed.
 /// </summary>
 /// <param name="operation">The change operation being sought.</param>
 /// <param name="objectType">The change object type being sought.</param>
 /// <returns>The first <see cref="ChangeEntry"/> matching the search conditions.</returns>
 public ChangeEntry FindChange(ChangeOperation operation, ChangeObjectType objectType)
 {
     return FindChange(operation, objectType, null);
 }
 /// <summary>
 /// Searches the current page of change entries for the type of object and operation changed and the modifier involved.
 /// </summary>
 /// <param name="operation">The change operation being sought.</param>
 /// <param name="objectType">The change object type being sought.</param>
 /// <param name="modifier">The change object modifier involved being sought.</param>
 /// <returns>
 /// The list of <see cref="ChangeEntry" />s matching the search conditions.
 /// </returns>
 public List<ChangeEntry> FindChanges(ChangeOperation operation, ChangeObjectType objectType, ChangeObjectModifier? modifier)
 {
     return FindChanges(new ChangeOperation[] { operation }, new ChangeObjectType[] { objectType }, modifier != null ? new ChangeObjectModifier[] { modifier.Value } : Enum.GetValues(typeof(ChangeObjectModifier)).Cast<ChangeObjectModifier>());
 }
 /// <summary>
 /// Searches the current page of change entries for the type of object and operation changed.
 /// </summary>
 /// <param name="operation">The change operation being sought.</param>
 /// <param name="objectType">The change object type being sought.</param>
 /// <returns>
 /// The list of <see cref="ChangeEntry" />s matching the search conditions.
 /// </returns>
 public List<ChangeEntry> FindChanges(ChangeOperation operation, ChangeObjectType objectType)
 {
     return FindChanges(new ChangeOperation[] { operation }, new ChangeObjectType[] { objectType });
 }