예제 #1
0
        private void Butler_RequestReceived(object sender, JsonRpcRequestEventArgs e)
        {
            switch (e.Request.Method)
            {
            case Butler.Methods.PickManifestAction:
                var pick = e.Request.GetParams <PickManifestAction>();
                butler.SendResponse(e.Request, new Dictionary <string, int>
                {
                    { "index", 0 }
                });
                break;

            case Butler.Methods.HTMLLaunch:
                var html = e.Request.GetParams <HTMLLaunch>();
                ProcessStarter.StartProcess(Path.Combine(html.rootFolder, html.indexPath));
                butler.SendResponse(e.Request);
                break;

            case Butler.Methods.URLLaunch:
                var url = e.Request.GetParams <URLLaunch>();
                ProcessStarter.StartUrl(url.url);
                butler.SendResponse(e.Request);
                break;

            case Butler.Methods.ShellLaunch:
                var shell = e.Request.GetParams <ShellLaunch>();
                ProcessStarter.StartProcess(shell.itemPath);
                butler.SendResponse(e.Request);
                break;

            case Butler.Methods.PrereqsFailed:
                var error = e.Request.GetParams <PrereqsFailed>();
                butler.SendResponse(e.Request, new Dictionary <string, bool>
                {
                    { "continue", true }
                });
                break;
            }
        }
예제 #2
0
 private void Client_RequestReceived(object sender, JsonRpcRequestEventArgs e)
 {
     RequestReceived?.Invoke(this, e);
 }