// // Driven by user IDE subs: public bool NewIDEbyUser(out IIDE newIde) { if (VirtualMachineBuilder?.VisibleTypes.Count < 1) { OnShowingMessage("There're no available Virtual Machine types to add in a new IDE. Check types settings via Component Manager." , "Workplace Configuration Warning in " + Title, MessageBoxIcon.Exclamation); newIde = null; return(false); } if (CodeEditorBuilder?.VisibleTypes.Count < 1) { OnShowingMessage("There're no available Code Editor types to add in a new IDE. Check types settings via Component Manager." , "Workplace Configuration Warning in " + Title, MessageBoxIcon.Exclamation); newIde = null; return(false); } // IVirtualMachine machine = null; ICodeEditor codeEditor = null; IInputPort inputPort = null; int withInputPortIndex = -1; IOutputPort outputPort = null; int withOutputPortIndex = -1; bool withConsole = false; newIde = null; DialogResult newIDEdialogResult; using (var newIDEdialog = new NewIdeDialog(VirtualMachineBuilder.VisibleTypes, CodeEditorBuilder.VisibleTypes , InputPortBuilder.VisibleTypes, OutputPortBuilder.VisibleTypes , InputDeviceBuilder.VisibleTypes.Any(t => t.TypeName == typeof(ConsoleDevice).Name) || OutputDeviceBuilder.VisibleTypes.Any(t => t.TypeName == typeof(ConsoleDevice).Name))) { newIDEdialogResult = newIDEdialog.ShowDialog(MainForm as Form); if (newIDEdialogResult == DialogResult.OK) { machine = VirtualMachineBuilder.GetNew(VirtualMachineBuilder.VisibleTypes[newIDEdialog.ChosenMachineTypeIndex]); machine.CurrentLanguage = newIDEdialog.ChosenLanguage; codeEditor = CodeEditorBuilder.GetNew(CodeEditorBuilder.VisibleTypes[newIDEdialog.ChosenCodeEditorTypeIndex]); inputPort = newIDEdialog.ChosenInputPortTypeFullName.IsNotNullOrEmpty() ? InputPortBuilder.GetNew(InputPortBuilder.VisibleTypes[newIDEdialog.ChosenInputPortTypeIndex]) : null; withInputPortIndex = newIDEdialog.ChosenInputPortIndex; outputPort = newIDEdialog.ChosenOutputPortTypeFullName.IsNotNullOrEmpty() ? OutputPortBuilder.GetNew(OutputPortBuilder.VisibleTypes[newIDEdialog.ChosenOutputPortTypeIndex]) : null; withOutputPortIndex = newIDEdialog.ChosenOutputPortIndex; withConsole = newIDEdialog.ChosenWithConsole; } } if (newIDEdialogResult != DialogResult.OK) { return(false); } newIde = NewIDE(machine, codeEditor, inputPort, withInputPortIndex , outputPort, withOutputPortIndex, withConsole); return(true); }
XAMLatorMonitor(IIDE ide) { this.ide = ide; clients = new Dictionary <DeviceInfo, HttpClient>(); discovery = new DiscoveryReceiver(); discovery.DevicesChanged += HandleDiscoveryDevicesChanged; discovery.Start(); ide.DocumentChanged += HandleDocumentChanged; }
internal XAMLatorMonitor(IIDE ide, ITcpCommunicatorServer server = null) { IDE = ide; if (server == null) { server = new TcpCommunicatorServer(); } this.server = server; server.DataReceived += HandleDataReceived; ide.DocumentChanged += HandleDocumentChanged; }
public SaveCurrentSessionCommand( PackageAccessor packageAccessor, ISessionManager sessionManager, IIDE ide, ILogger logger) { _package = packageAccessor.Package; _sessionManager = sessionManager; _ide = ide; _logger = logger; _saveLock = new object(); }
public void RunIDE(IIDE ide) { (ide as LinuxIDE).ShowMaximized(); try { QApplication.Exec(); } catch (Exception e) { m_Log.Error("An exception occurred while running the Linux platform.", e); if (!LinuxPlatform.ShuttingDown) throw new ApplicationException("The application is unable to continue due to an inconsistant Qt state.", e); } }
public void RunIDE(IIDE ide) { (ide as LinuxIDE).ShowMaximized(); try { QApplication.Exec(); } catch (Exception e) { m_Log.Error("An exception occurred while running the Linux platform.", e); if (!LinuxPlatform.ShuttingDown) { throw new ApplicationException("The application is unable to continue due to an inconsistant Qt state.", e); } } }
// // Naming service subs: public string GetNewProgramFileShortName(IIDE ide) { if (ide == null) { throw new NullReferenceException(); } string name; name = "New_"; name += (ide.Machine.CurrentLanguage.IsNotNullOrEmpty()) ? ide.Machine.CurrentLanguage : ide.Machine.BaseLanguage; name += "_program"; int lastnumber = -1; int num = -1; foreach (IIDE ide_ in IDEs) { if (ide_.ProgramFile.ShortFileName.IndexOf(name) == 0) { if ((ide_.ProgramFile.ShortFileName + "|").Substring(name.Length) == "|") { num = 1; } else if (ide_.ProgramFile.ShortFileName.Length - name.Length > 3 && ide_.ProgramFile.ShortFileName.Substring(name.Length, 2) == " (" && XString.Right(ide_.ProgramFile.ShortFileName, 1) == ")") { string snum = ide_.ProgramFile.ShortFileName.Substring(name.Length + 2); snum = snum.Substring(0, snum.Length - 1); if (!Int32.TryParse(snum, out num)) { num = -1; } } } if (num > lastnumber) { lastnumber = num; } } lastnumber++; name += (lastnumber > 1) ? " (" + lastnumber.ToString() + ")" : ""; return(name); }
public string GetNewIDEtitle(IIDE ide) { if (ide == null) { throw new NullReferenceException(); } string name; name = ((ide.Machine.CustomName.IsNotNullOrEmpty()) ? ide.Machine.CustomName : ide.Machine.DefaultName); name += " IDE"; int lastnumber = -1; int num = -1; foreach (IIDE ide_ in IDEs) { if (ide_.Title.IndexOf(name) == 0) { if ((ide_.Title + "|").Substring(name.Length) == "|") { num = 1; } else if (ide_.Title.Length - name.Length > 3 && ide_.Title.Substring(name.Length, 2) == " (" && XString.Right(ide_.Title, 1) == ")") { string snum = ide_.Title.Substring(name.Length + 2); snum = snum.Substring(0, snum.Length - 1); if (!Int32.TryParse(snum, out num)) { num = -1; } } } if (num > lastnumber) { lastnumber = num; } } lastnumber++; name += (lastnumber > 1) ? " (" + lastnumber.ToString() + ")" : ""; return(name); }
public async Task CloseIDE(IIDE ide, bool immediately = false) { if (ide == null) { throw new NullReferenceException(); } if (MainForm.SelectedIDE == ide) { int i = IDEs.IndexOf(ide); if (i + 1 < IDEs.Count) { MainForm.SelectIDE(IDEs[i + 1]); } else if (i > 0) { MainForm.SelectIDE(IDEs[i - 1]); } else { MainForm.SelectIDE(null); } } IDEs.Remove(ide); ide.ShowingMessage -= MainSymbolService.ShowMessage; ide.AskingUser -= MainSymbolService.AskUser; ide.OpeningFileByUser -= MainSymbolService.OpenFileByUser; ide.SavingFileByUser -= MainSymbolService.SaveFileByUser; if (!immediately) { await ide.DisposeAsync(immediately); } else { ide.DisposeAsync(immediately); } OnGotUpdated(); }
public static XAMLatorMonitor Init(IIDE ide) { Instance = new XAMLatorMonitor(ide); return(Instance); }
XAMLatorMonitor(IIDE ide) { IDE = ide; server = new TcpCommunicatorServer(Constants.DEFAULT_PORT); ide.DocumentChanged += HandleDocumentChanged; }
public void MainFormSelectIDE(IIDE ide) { MainForm.SelectIDE(ide); }
public RestoreSessionCommand(IIDE ide, SessionManagerToolWindowState sessionManagerToolWindowState) { _ide = ide; _sessionManagerToolWindowState = sessionManagerToolWindowState; }
public void SaveIDE(IIDE ide) { throw new NotImplementedException(); }
public void RunIDE(IIDE ide) { Application.Run(ide as WindowsIDE); }
public StdCodeEditor(IIDE parentIDE) { InitializeComponent(); // _ParentIDE = parentIDE; }
public void SaveIDEas(IIDE ide, string fileName) { throw new NotImplementedException(); }
public CloseSessionDocumentsCommand(IIDE ide, SessionManagerToolWindowState sessionManagerToolWindowState, PackageAccessor packageAccessor) { _ide = ide; _sessionManagerToolWindowState = sessionManagerToolWindowState; _package = packageAccessor.Package; }
public async Task <bool> CloseIDEbyUser(IIDE ide, bool immediately = false) // = null, DialogResult autoSave = DialogResult.None) { if (ide == null) { throw new NullReferenceException(); } if (ide.Machine.Status != VirtualMachineRunningStatus.StandBy) { IStateShottable ssm = ide.Machine as IStateShottable; if (ssm != null) { DialogResult answer = //(autoSave != DialogResult.None) ? autoSave : OnAskingUser("Machine " + ((ide.Machine.CustomName.IsNotNullOrEmpty()) ? ide.Machine.CustomName : ide.Machine.DefaultName) + " is running now. Pause it and save state before closing the IDE?", "Unsaved changes in " + ide.Title, MessageBoxButtons.YesNoCancel); switch (answer) { case DialogResult.Yes: await ssm.PauseAsync(); if (!ide.SaveMachineStateByUser()) { return(false); } break; case DialogResult.Cancel: return(false); } } } if (!ide.ProgramFile.IsChangesSaved) { DialogResult answer = //(autoSave != DialogResult.None) ? autoSave : OnAskingUser("Save changes in file " + ide.ProgramFile.ShortFileName + " before closing the IDE?", "Unsaved changes in " + ide.Title, MessageBoxButtons.YesNoCancel); switch (answer) { case DialogResult.Yes: if (!ide.SaveProgramFileByUser()) { return(false); } break; case DialogResult.Cancel: return(false); } } if (!ide.ConfigFile.IsChangesSaved) { DialogResult answer = //(autoSave != DialogResult.None) ? autoSave : OnAskingUser("Save changes in file " + ide.ConfigFile.ShortFileName + " before closing the IDE?", "Unsaved changes in " + ide.Title, MessageBoxButtons.YesNoCancel); switch (answer) { case DialogResult.Yes: if (!SaveIDEbyUser(ide)) { return(false); } break; case DialogResult.Cancel: return(false); } } await CloseIDE(ide, immediately); return(true); }
public bool SaveIDEasByUser(IIDE ide) { throw new NotImplementedException(); }
public bool OpenIDEbyUser(out IIDE ide) { throw new NotImplementedException(); }