/// <summary> /// adds a new mainunit to the system /// </summary> private void AddMainUnit() { if (!LibraryData.SystemIsOpen) { LibraryData.CreateEmptySystem(); } var t = new UcEscNum(LibraryData.FuturamaSys.MainUnits.Select(n => n.Id).ToList()); if (t.ShowDialog() == false) { return; } var mu = LibraryData.AddEsc(t.Result); if (mu == null) { return; } var newunit = new MainUnitViewModel(mu, this); TabCollection.Add(newunit); OnSystemChanged(new SystemChangedEventArgs() { NewMainUnit = newunit }); }
private void AddMainUnit(int id) { if (!LibraryData.SystemIsOpen) { LibraryData.CreateEmptySystem(); } var esc = LibraryData.AddEsc(id); if (esc == null) { return; } var escview = new MainUnitViewModel(esc, this); if (!TabCollection.Contains(escview)) { TabCollection.Add(escview); } }