void OnBackendStopped(object ob, EventArgs args) { // The backend process crashed, try to restart it Backend = null; backendController = new ApplicationBackendController(this, channelId); backendController.StartBackend(); OnBackendChanged(true); }
void OnNewBackendStarted(object ob, EventArgs args) { OnBackendChanging(); ApplicationBackendController oldBackend = backendController; backendController = (ApplicationBackendController)ob; OnBackendChanged(true); oldBackend.StopBackend(false); }
public IsolatedApplication (IsolationMode mode) { if (mode == IsolationMode.None) throw new ArgumentException ("mode"); channelId = RegisterRemotingChannel (mode); backendController = new ApplicationBackendController (this, channelId); backendController.StartBackend (); OnBackendChanged (false); }
public IsolatedApplication(IsolationMode mode) { if (mode == IsolationMode.None) { throw new ArgumentException("mode"); } channelId = RegisterRemotingChannel(mode); backendController = new ApplicationBackendController(this, channelId); backendController.StartBackend(); OnBackendChanged(false); }
public static void Main() { Gdk.Threads.Init(); Gtk.Application.Init(); System.Threading.Thread.CurrentThread.Name = "gui-thread"; new Gnome.Program("SteticBackend", "0.0", Gnome.Modules.UI, new string[0]); // Read the remoting channel to use string channel = Console.In.ReadLine(); IServerChannelSinkProvider formatterSink = new BinaryServerFormatterSinkProvider(); formatterSink.Next = new GuiDispatchServerSinkProvider(); string unixPath = null; if (channel == "unix") { unixPath = System.IO.Path.GetTempFileName(); Hashtable props = new Hashtable(); props ["path"] = unixPath; props ["name"] = "__internal_unix"; ChannelServices.RegisterChannel(new UnixChannel(props, null, formatterSink)); } else { Hashtable props = new Hashtable(); props ["port"] = 0; props ["name"] = "__internal_tcp"; ChannelServices.RegisterChannel(new TcpChannel(props, null, formatterSink)); } // Read the reference to the application string sref = Console.In.ReadLine(); byte[] data = Convert.FromBase64String(sref); MemoryStream ms = new MemoryStream(data); BinaryFormatter bf = new BinaryFormatter(); controller = (ApplicationBackendController)bf.Deserialize(ms); ApplicationBackend backend = new ApplicationBackend(controller.Application); controller.Connect(backend); Gdk.Threads.Enter(); Gtk.Application.Run(); Gdk.Threads.Leave(); controller.Disconnect(backend); }
internal override void RestartBackend() { // The backend process needs to be restarted. // This is done in background. ThreadPool.QueueUserWorkItem(delegate { try { // Start the new backend ApplicationBackendController newController = new ApplicationBackendController(this, channelId); newController.StartBackend(); Gtk.Application.Invoke(newController, EventArgs.Empty, OnNewBackendStarted); } catch { // FIXME: show an error message } }); }
public static void Main () { Gdk.Threads.Init (); Gtk.Application.Init (); System.Threading.Thread.CurrentThread.Name = "gui-thread"; // Read the remoting channel to use string channel = Console.In.ReadLine (); IServerChannelSinkProvider formatterSink = new BinaryServerFormatterSinkProvider (); formatterSink.Next = new GuiDispatchServerSinkProvider (); string unixPath = null; if (channel == "unix") { unixPath = System.IO.Path.GetTempFileName (); Hashtable props = new Hashtable (); props ["path"] = unixPath; props ["name"] = "__internal_unix"; ChannelServices.RegisterChannel (new UnixChannel (props, null, formatterSink), false); } else { Hashtable props = new Hashtable (); props ["port"] = 0; props ["name"] = "__internal_tcp"; ChannelServices.RegisterChannel (new TcpChannel (props, null, formatterSink), false); } // Read the reference to the application string sref = Console.In.ReadLine (); byte[] data = Convert.FromBase64String (sref); MemoryStream ms = new MemoryStream (data); BinaryFormatter bf = new BinaryFormatter (); controller = (ApplicationBackendController) bf.Deserialize (ms); ApplicationBackend backend = new ApplicationBackend (controller.Application); controller.Connect (backend); Gdk.Threads.Enter (); Gtk.Application.Run (); Gdk.Threads.Leave (); controller.Disconnect (backend); }
void OnBackendStopped (object ob, EventArgs args) { // The backend process crashed, try to restart it Backend = null; backendController = new ApplicationBackendController (this, channelId); backendController.StartBackend (); OnBackendChanged (true); }
void OnNewBackendStarted (object ob, EventArgs args) { OnBackendChanging (); ApplicationBackendController oldBackend = backendController; backendController = (ApplicationBackendController) ob; OnBackendChanged (true); oldBackend.StopBackend (false); }
internal override void RestartBackend () { // The backend process needs to be restarted. // This is done in background. ThreadPool.QueueUserWorkItem (delegate { try { // Start the new backend ApplicationBackendController newController = new ApplicationBackendController (this, channelId); newController.StartBackend (); Gtk.Application.Invoke (newController, EventArgs.Empty, OnNewBackendStarted); } catch { // FIXME: show an error message } }); }