internal ModelEventHandler( IContentTypeModuleBase contentTypeModuleBase, Action <TypedEventHandler <Tservice, MoveEventArgs <Tentity> >, SubscribeType> trashEventSubscriber, Action <TypedEventHandler <Tservice, DeleteEventArgs <Tentity> >, SubscribeType> deleteEventSubscriber, Action <TypedEventHandler <Tservice, NewEventArgs <Tentity> >, SubscribeType> createEventSubscriber, Action <TypedEventHandler <Tservice, SaveEventArgs <Tentity> >, SubscribeType> saveEventSubscriber, Action <TypedEventHandler <Tservice, MoveEventArgs <Tentity> >, SubscribeType> moveEventSubscriber, Action <TypedEventHandler <Tservice, CopyEventArgs <Tentity> >, SubscribeType> copyEventSubscriber, Action <TypedEventHandler <IPublishingStrategy, PublishEventArgs <Tentity> >, SubscribeType> publishEventSubscriber, Action <TypedEventHandler <IPublishingStrategy, PublishEventArgs <Tentity> >, SubscribeType> unpublishEventSubscriber, Func <IContentBase, ContentTypeRegistration, object> createInstance, Func <Tentity, string> getAliasFromContentInstance, Action <Tentity, CodeFirstContentBase <Tnodedetails>, ContentTypeRegistration> mapModelToContent) { _contentTypeModuleBase = contentTypeModuleBase; _createInstance = createInstance; _getAliasFromContentInstance = getAliasFromContentInstance; _mapModelToContent = mapModelToContent; _trashEventSubscriber = trashEventSubscriber; _deleteEventSubscriber = deleteEventSubscriber; _createEventSubscriber = createEventSubscriber; _saveEventSubscriber = saveEventSubscriber; _moveEventSubscriber = moveEventSubscriber; _copyEventSubscriber = copyEventSubscriber; _publishEventSubscriber = publishEventSubscriber; _unpublishEventSubscriber = unpublishEventSubscriber; }
public ContentModelModuleBase(IDataTypeModule dataTypeModule, IContentTypeModuleBase contentTypeModule, Func <Tentity, string> aliasGetter, Action <TypedEventHandler <Tservice, MoveEventArgs <Tentity> >, SubscribeType> trashEventSubscriber, Action <TypedEventHandler <Tservice, DeleteEventArgs <Tentity> >, SubscribeType> deleteEventSubscriber, Action <TypedEventHandler <Tservice, NewEventArgs <Tentity> >, SubscribeType> createEventSubscriber, Action <TypedEventHandler <Tservice, SaveEventArgs <Tentity> >, SubscribeType> saveEventSubscriber, Action <TypedEventHandler <Tservice, MoveEventArgs <Tentity> >, SubscribeType> moveEventSubscriber, Action <TypedEventHandler <Tservice, CopyEventArgs <Tentity> >, SubscribeType> copyEventSubscriber, Action <TypedEventHandler <IPublishingStrategy, PublishEventArgs <Tentity> >, SubscribeType> publishEventSubscriber, Action <TypedEventHandler <IPublishingStrategy, PublishEventArgs <Tentity> >, SubscribeType> unpublishEventSubscriber) { _dataTypeModule = dataTypeModule; _contentTypeModule = contentTypeModule; _eventHandler = new ModelEventHandler <Tservice, Tentity, T>( contentTypeModule, trashEventSubscriber, deleteEventSubscriber, createEventSubscriber, saveEventSubscriber, moveEventSubscriber, copyEventSubscriber, publishEventSubscriber, unpublishEventSubscriber, (x, y) => CreateInstanceFromContent(x, y), aliasGetter, (x, y, z) => MapModelToContent(x, y, z) ); }