internal ActionCollection([NotNull] V2Interop.ITaskDefinition iTaskDef) { v2Def = iTaskDef; v2Coll = iTaskDef.Actions; System.Text.RegularExpressions.Match match; if (iTaskDef.Data != null && (match = System.Text.RegularExpressions.Regex.Match(iTaskDef.Data, psV2IdRegex)).Success) { bool on = bool.Parse(match.Groups["v"].Value); if (on) { psConvert |= PowerShellActionPlatformOption.Version2; } else { psConvert &= ~PowerShellActionPlatformOption.Version2; } } UnconvertUnsupportedActions(); }
internal virtual void Bind(V2Interop.ITaskDefinition iTaskDef) { V2Interop.IActionCollection iActions = iTaskDef.Actions; switch (this.GetType().Name) { case "ComHandlerAction": iAction = iActions.Create(TaskActionType.ComHandler); break; case "ExecAction": iAction = iActions.Create(TaskActionType.Execute); break; case "EmailAction": iAction = iActions.Create(TaskActionType.SendEmail); break; case "ShowMessageAction": iAction = iActions.Create(TaskActionType.ShowMessage); break; default: throw new ArgumentException(); } Marshal.ReleaseComObject(iActions); foreach (string key in unboundValues.Keys) { try { iAction.GetType().InvokeMember(key, System.Reflection.BindingFlags.SetProperty, null, iAction, new object[] { unboundValues[key] }); } catch (System.Reflection.TargetInvocationException tie) { throw tie.InnerException; } catch { } } unboundValues.Clear(); }
/// <summary> /// Releases all resources used by this class. /// </summary> public void Dispose() { v1Task = null; v2Def = null; v2Coll = null; }
internal ActionCollection(V2Interop.ITaskDefinition iTaskDef) { v2Def = iTaskDef; v2Coll = iTaskDef.Actions; }
internal ActionCollection(V2Interop.ITaskDefinition iTaskDef) { v2Def = iTaskDef; v2Coll = iTaskDef.Actions; UnconvertUnsupportedActions(); }