import {EventInvokeEnum} from '../EventInvokeEnum'; //========================================================== // 事件处理类。 // // @tool // @param owner:Object 拥有者 // @param invokeName:String 函数名称 // @param clazz:Function 类名称 // @author maocy // @version 141231 //========================================================== export class DispatchEvent { public owner: any; public invoke: string; public invokeCd: EventInvokeEnum; public clazz: Function; public parameters: any; public constructor() { } //========================================================== // 测试是否是事件前处理。 // // @return Boolean 事件前处理 //========================================================== public isBefore() { return this.invokeCd == EventInvokeEnum.Before; } //========================================================== // 测试是否是事件后处理。 // // @return Boolean 事件后处理 //========================================================== public isAfter() { return this.invokeCd == EventInvokeEnum.After; } //========================================================== // 释放当前实例。 // // @method //========================================================== public dispose() { this.owner = null; this.invoke = null; this.clazz = null; this.invokeCd = null; } //========================================================== // 获取事件对象的运行信息。 // // @method // @return String 运行信息 //========================================================== public dump() { //return MO.Class.dump(this) + ':owner=' + this.owner + ',type=' + this.type + '.invoke=' + MO.Method.name(this.invoke); } }