public static (ScriptBlock, Dictionary <string, object>) GetEventHandler(IPsEventControl control, string eventName) { return(control.PsEventHandlers.ContainsKey(eventName) ? control.PsEventHandlers[eventName] : (null, null)); }
public static void SetEventHandlerScript(IPsEventControl control, string eventName, ScriptBlock handler) { control.PsEventHandlers[eventName] = (handler, PsEventControlHelper.CaptureLocalVariables(control.Cmdlet)); }
public static ScriptBlock GetEventHandlerScript(IPsEventControl control, string eventName) { return(control.PsEventHandlers.ContainsKey(eventName) ? control.PsEventHandlers[eventName].Item1 : null); }