public string GetArguments(string url, Point position, Size size) { var args = _arguments.Replace("{{url}}", url); if (position != null) { args += " " + _positionArgs .Replace("{{x}}", position.X.ToString()) .Replace("{{y}}", position.Y.ToString()); } if (size != null) { args += " " + _sizeArgs .Replace("{{width}}", size.Width.ToString()) .Replace("{{height}}", size.Height.ToString()); } return args; }
public UI.Browser start(UI.Point position, UI.Size size) { _client = new UI.Browser(() => { var body = Request("belly:get-window-title"); if (body != null) { return(body.title); } return(""); }); var url = _server.Url; var ws = _channel.Url; _client.Launch(url, ws, position, size); return(_client); }
internal void Launch(string url, string ws, Point position, Size size) { var locator = new BrowserLocator(); var browser = locator.Find(); if (browser != null) { _process = new Process(); var info = new ProcessStartInfo( browser.Executable, browser.GetArguments(url + "/site/index.html?channel="+ws, position, size) ); info.WindowStyle = ProcessWindowStyle.Minimized; info.UseShellExecute = false; info.RedirectStandardOutput = true; info.RedirectStandardError = true; _process.StartInfo = info; _process.Start(); } }
public UI.Browser Start(int serverPort, int channelPort, UI.Point position, UI.Size size) { StartHeadless(serverPort, channelPort); return(start(position, size)); }
public UI.Browser Start(UI.Point position, UI.Size size) { StartHeadless(); return(start(position, size)); }