Ejemplo n.º 1
0
        internal static PsRequest New(Object requestObject, PowerShellProviderBase provider, string methodName)
        {
            if (requestObject is IAsyncAction)
            {
                ((IAsyncAction)(requestObject)).OnCancel += provider.CancelRequest;
                ((IAsyncAction)(requestObject)).OnAbort  += provider.CancelRequest;
            }
            var req = requestObject.As <PsRequest>();

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

            req.CommandInfo = provider.GetMethod(methodName);
            if (req.CommandInfo == null) {
                req.Debug("METHOD_NOT_IMPLEMENTED", methodName);
            }
            req._provider = provider;
            return req;
        }