Ejemplo n.º 1
0
        private async void SendScriptingCompleteEvent <TParams>(RequestContext <ScriptingResult> requestContext, EventType <TParams> eventType, TParams parameters,
                                                                SmoScriptingOperation operation, string scriptDestination)
        {
            await requestContext.SendEvent(eventType, parameters);

            switch (scriptDestination)
            {
            case "ToEditor":
                await requestContext.SendResult(new ScriptingResult { OperationId = operation.OperationId, Script = operation.ScriptText });

                break;

            case "ToSingleFile":
                await requestContext.SendResult(new ScriptingResult { OperationId = operation.OperationId });

                break;

            default:
                await requestContext.SendError(string.Format("Operation {0} failed", operation.ToString()));

                break;
            }
        }