protected bool GetActionAndRemove(out CimBaseAction action) { return this.actionQueue.TryDequeue(out action); }
/// <summary> /// <para> /// Get action object from action queue /// </para> /// </summary> /// <param name="action">Next action to execute.</param> /// <returns>True indicates there is an valid action, otherwise false.</returns> protected bool GetActionAndRemove(out CimBaseAction action) { return(this.actionQueue.TryDequeue(out action)); }
public CmdletActionEventArgs(CimBaseAction action) { this.Action = action; }
/// <summary> /// <para> /// Trigger an event that new action available /// </para> /// </summary> /// <param name="action"></param> protected void FireNewActionEvent(CimBaseAction action) { DebugHelper.WriteLogEx(); CmdletActionEventArgs actionArgs = new CmdletActionEventArgs(action); if (!PreNewActionEvent(actionArgs)) { return; } NewCmdletActionHandler temp = this.OnNewCmdletAction; if (temp != null) { temp(this.session, actionArgs); } else { DebugHelper.WriteLog("Ignore action since OnNewCmdletAction is null.", 5); } this.PostNewActionEvent(actionArgs); }
protected void FireNewActionEvent(CimBaseAction action) { DebugHelper.WriteLogEx(); CmdletActionEventArgs cmdletActionEventArg = new CmdletActionEventArgs(action); if (this.PreNewActionEvent(cmdletActionEventArg)) { CimSessionProxy.NewCmdletActionHandler newCmdletActionHandler = this.OnNewCmdletAction; if (newCmdletActionHandler == null) { DebugHelper.WriteLog("Ignore action since OnNewCmdletAction is null.", 5); } else { newCmdletActionHandler(this.session, cmdletActionEventArg); } this.PostNewActionEvent(cmdletActionEventArg); return; } else { return; } }