public void LoadActions() { actions = DesignUtil.GetActions(_map); eventHandlers = DesignUtil.GetEventHandlers(_map); if (ProjectEnvironment.RunMode) //&& _map.ParanetMap == null) { //if an action is for executing a custom method then the actions inside the method //only holds actions ID's. We need associate actions objects to those action ID's //by going through all action branches foreach (IAction a in actions) { //ActionCustom ac = a as ActionCustom; //if (ac != null) //{ // ac.SetActions(actions); //} CustomMethodPointer cmp = a.ActionMethod as CustomMethodPointer; if (cmp != null) { cmp.MethodDef.SetActions(actions); } } //link events to actions foreach (EventAction ea in eventHandlers) { if (ea.Event.ObjectInstance != null) { SetEventLink(ea.Event); } } } }
public EventAction GetEventHandler(string eventName, string objKey) { if (eventHandlers == null) { eventHandlers = DesignUtil.GetEventHandlers(_map); } foreach (EventAction ea in eventHandlers) { if (ea.Event.Name == eventName) { if (ea.Event.Owner.ObjectKey == objKey) { return(ea); } } } return(null); }
public void SaveEventBreakPointsToXml(string eventName, string objKey) { if (eventHandlers == null) { eventHandlers = DesignUtil.GetEventHandlers(_map); } foreach (EventAction ea in eventHandlers) { if (ea.Event.Name == eventName) { if (ea.Event.Owner.ObjectKey == objKey) { ea.SaveEventBreakPointsToXml(); break; } } } }