In firing order:
OnActivated
- content item object hierarchy has been created, but not yet fetched from db
Used for preparing content part for further usage. Eg. setting getters and setters for lazy loaded objects, setting up delegates etc. Think of it as of a "constructor" for a given part.
OnInitializing
- content item object hierarchy has been created, but not yet fetched from db.
Used for setting initial/default property values for a given part.
OnLoading
- content item is about to be loaded from db.
Used for various things. Fired only if an item exists in the database and is about to be loaded. Orchard core uses this event to set up lazy loaders for part records.
OnLoaded
- content item has been loaded from db
Used for various things. Fired only if an item exists in the database and all record loaders have been set. You can be sure that part.Record
will not be null for any part at this point and will contain data fetched from database.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…