public static Cloud UseHook(this Cloud cloud, string className, EngineHookType hookType, EngineObjectWithUserHookDelegateSynchronous hookDelegate) { return(cloud.UseHook(className, hookType, (EngineObjectHookContext context) => { return Task.Factory.StartNew(() => hookDelegate(context.TheObject, context.By)); })); }
public static Cloud UseHook(this Cloud cloud, string className, EngineHookType hookType, EngineObjectWithUserHookDelegate hookDelegate) { return(cloud.UseHook(className, hookType, (EngineObjectHookContext context) => { return hookDelegate(context.TheObject, context.By); })); }
public static Cloud UseHook(this Cloud cloud, string className, EngineHookType hookType, EngineHookDelegate hookDelegate) { switch (hookType) { case EngineHookType.BeforeSave: cloud.BeforeSave(className, hookDelegate); break; case EngineHookType.AfterSave: cloud.AfterSave(className, hookDelegate); break; case EngineHookType.BeforeUpdate: cloud.BeforeUpdate(className, hookDelegate); break; case EngineHookType.AfterUpdate: cloud.AfterUpdate(className, hookDelegate); break; case EngineHookType.BeforeDelete: cloud.BeforeDelete(className, hookDelegate); break; case EngineHookType.AfterDelete: cloud.AfterDelete(className, hookDelegate); break; default: break; } return(cloud); }
public static Cloud UseHook(this Cloud cloud, string className, EngineHookType hookType, EngineHookDelegateSynchronous hookDelegate) { EngineHookDelegate del = (context) => { return(Task.Factory.StartNew(() => hookDelegate(context))); }; return(cloud.UseHook(className, hookType, del)); }
public static Cloud UseHook <TAVObject>(this Cloud cloud, EngineHookType hookType, EngineObjectHookDelegate <TAVObject> hookDelegate) where TAVObject : AVObject { var className = AVObject.GetSubClassName <TAVObject>(); return(cloud.UseHook(className, hookType, (EngineObjectHookContext context) => { return hookDelegate(context.TheObject as TAVObject); })); }
public EngineObjectHookAttribute(string className, EngineHookType hookType) { this.ClassName = className; this.HookType = hookType; }