internal static Request New(Object requestImpl, PowerShellProviderBase provider, string methodName) { var req = requestImpl.As <Request>(); req.CommandInfo = provider.GetMethod(methodName); if (req.CommandInfo == null) { req.Debug("METHOD_NOT_IMPLEMENTED", methodName); } req._provider = provider; return(req); }
internal static Request New(Object requestObject, PowerShellProviderBase provider, string methodName) { if (requestObject is IAsyncAction) { ((IAsyncAction)(requestObject)).OnCancel += provider.CancelRequest; } var req = requestObject.As <Request>(); req.CommandInfo = provider.GetMethod(methodName); if (req.CommandInfo == null) { req.Debug("METHOD_NOT_IMPLEMENTED", methodName); } req._provider = provider; return(req); }