コード例 #1
0
 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));
     }));
 }
コード例 #2
0
 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);
     }));
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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);
            }));
        }
コード例 #6
0
 public EngineObjectHookAttribute(string className, EngineHookType hookType)
 {
     this.ClassName = className;
     this.HookType  = hookType;
 }