示例#1
0
		/// <summary>Invokes the notifier's saving event.</summary>
		/// <param name="entity">The potential content item to notify about.</param>
		/// <param name="id">Ignored.</param>
		/// <param name="currentState">Ignored.</param>
		/// <param name="previousState">Ignored.</param>
		/// <param name="propertyNames">Ignored.</param>
		/// <param name="types">Ignored.</param>
		/// <returns>True if the entity was a content item.</returns>
		public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types)
		{
			bool wasHandled = HandleSaveOrUpdate(entity as ContentItem, propertyNames, currentState);
			bool wasAltered = interceptor.OnSaving(entity);
			if (wasHandled || wasAltered)
			{
				logger.Debug("OnFlushDirty: " + entity + " " + id);
				return true;
			}
			return false;
		}
示例#2
0
 public string Serialize(ContentItem item)
 {
     foreach (var descendant in Find.EnumerateChildren(item, true, false))
     {
         proxyFactory.OnSaving(descendant);
     }
     return(ContentVersion.Serialize(exporter, item));
 }
示例#3
0
        public virtual void Save(TEntity entity)
        {
            LastOperation = "Save(" + entity + ")";

            object key = GetKey(entity);

            proxies.OnSaving(entity);
            database[key] = entity;

            if (key is int)
            {
                maxID = Math.Max(maxID, (int)key);
            }
        }
示例#4
0
 public void Serialize(BsonWriter bsonWriter, Type nominalType, object value, IBsonSerializationOptions options)
 {
     proxies.OnSaving(value);
     serializer.Serialize(bsonWriter, nominalType, value, options);
 }