コード例 #1
0
        /// <summary>
        /// Start a new server for web browser interop
        /// </summary>
        /// <param name="serverId">Id of the current web browser server</param>
        /// <param name="clientId">Id of the remote app client</param>
        /// <returns>Returns the instance of the web server</returns>
        public static WebBrowserServer Start(string serverId, string clientId)
        {
            var w = new WebBrowserServer();

            w.ServerId  = serverId;
            w.ServerUri = new Uri("net.pipe://localhost/" + w.ServerId);
            w.ClientId  = clientId;

            //Start current web server
            w._host = new ServiceHost(w, w.ServerUri);
            w._host.AddServiceEndpoint(typeof(IWebBrowserServer), new NetNamedPipeBinding(), "Web");
            w._host.Open();

            return(w);
        }
コード例 #2
0
 /// <summary>
 /// Element that allows to show the service control
 /// </summary>
 /// <param name="service">Service to show</param>
 public FormFrameworkElement(IFormService service)
 {
     _server = WebBrowserServer.Start(service.ControlServerId, service.AppServerId);
     WebBrowserInitializer.Initialize();
 }