public IViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject) { var openFile = new GtkPlugOpenedFile(); openFile.FileReference = fileName; openFile.SocketComms = new TcpListener(0); openFile.StartProcess = new Action(() => { openFile.NetworkRequestLayer = new GtkPlugNetworkRequestLayer(openFile.SocketComms); Console.WriteLine("Instance process is listening on port " + ((IPEndPoint)openedFileList.SocketComms.Server.LocalEndPoint).Port); openFile.GtkPlugProcess = editor.SpawnHostProcessExecutable(openedFileList, new string[] { "instance", ((IPEndPoint)openFile.SocketComms.Server.LocalEndPoint).Port .ToString(System.Globalization.CultureInfo.InvariantCulture), //viewSocket.SocketID.ToString(System.Globalization.CultureInfo.InvariantCulture), fileName, }); openFile.GtkPlugProcess.EnableRaisingEvents = true; openFile.NetworkRequestLayer.BlockUntilConnected(); }); openFile.StartProcess(); openedFileList.OpenedFiles.Add(openFile); var viewSocket = new GtkSocketViewContent(openFile); return viewSocket; }
public GtkSocketViewContent(GtkPlugOpenedFile openFile) { this.openFile = openFile; this.openFile.ViewContent = this; label = new Gtk.Label("Initializing..."); label.ParentSet += this.OnLabelParentChanged; label.ShowAll(); }