public void SuitInformation(SuitList shp, string whereami, ISystem system) { if (SuitID != ulong.MaxValue) { shp.Buy(EventTimeUTC, SuitID, Name, Name_Localised, Price); } }
public void SuitInformation(SuitList shp, string whereami, ISystem system) { if (SuitID != ulong.MaxValue) { shp.SwitchTo(EventTimeUTC, SuitID); } }
public void SuitsGroup(string suit) { if (Enum.TryParse(suit, out Suits myStatus)) { if (Suits(myStatus)) { throw new ArgumentException(); } else { SuitList.Add(myStatus); } } else { throw new ArgumentException(); } }
public void SuitInformation(SuitList shp, string whereami, ISystem system) { if (SuitID != ulong.MaxValue) { } }
private void DisplaySuits() { DataGridViewColumn sortcolprev = dataGridViewSuits.SortedColumn != null ? dataGridViewSuits.SortedColumn : dataGridViewSuits.Columns[0]; SortOrder sortorderprev = dataGridViewSuits.SortedColumn != null ? dataGridViewSuits.SortOrder : SortOrder.Ascending; int firstline = dataGridViewSuits.SafeFirstDisplayedScrollingRowIndex(); dataGridViewSuits.Rows.Clear(); System.Diagnostics.Debug.WriteLine("Clear Suit grid"); extPanelDataGridViewScrollSuits.SuspendLayout(); if (last_suits >= 0) { var suitlist = discoveryform.history.SuitList.Suits.Get(last_suits, x => x.Sold == false && !SuitList.SpecialID(x.ID)); // get unsold suits and ignore special IDs var fontscaled = EDDTheme.Instance.GetDialogScaledFont(0.8f); var cursuit = discoveryform.history.SuitList.CurrentID(last_suits); // get current suit ID, or 0 if none var curloadout = discoveryform.history.SuitLoadoutList.CurrentID(last_loadout); // get current loadout ID, or 0 if none foreach (var s in suitlist) { string stime = EDDiscoveryForm.EDDConfig.ConvertTimeToSelectedFromUTC(s.Value.EventTime).ToString(); string sname = s.Value.FriendlyName + "(" + (s.Value.ID % 10000) + ")"; string sprice = s.Value.Price.ToString("N0"); var loadouts = discoveryform.history.SuitLoadoutList.GetLoadoutsForSuit(last_loadout, s.Value.ID); if (loadouts == null || loadouts.Count == 0) { object[] rowobj = new object[] { stime, sname + (cursuit == s.Value.ID ? "*" : ""), sprice }; dataGridViewSuits.Rows.Add(rowobj); DataGridViewRow r = dataGridViewSuits.Rows[dataGridViewSuits.RowCount - 1]; r.Tag = s.Value; } else { int i = 0; foreach (var l in loadouts) { object[] rowobj = new object[] { }; var rw = dataGridViewSuits.RowTemplate.Clone() as DataGridViewRow; rw.CreateCells(dataGridViewSuits, stime, sname + (cursuit == s.Value.ID && curloadout == l.Value.ID ? "*" : ""), sprice, l.Value.Name + "(" + ((l.Value.ID % 10000).ToString()) + ")", l.Value.Modules.ContainsKey("primaryweapon1") ? l.Value.Modules["primaryweapon1"].FriendlyName : "", l.Value.Modules.ContainsKey("primaryweapon2") ? l.Value.Modules["primaryweapon2"].FriendlyName : "", l.Value.Modules.ContainsKey("secondaryweapon") ? l.Value.Modules["secondaryweapon"].FriendlyName : "" ); dataGridViewSuits.Rows.Add(rw); DataGridViewRow r = dataGridViewSuits.Rows[dataGridViewSuits.RowCount - 1]; r.Tag = s.Value; if (i > 0) // tried emptying the row and using tags to sort but it insists on putting empty cells at top/bottom { r.Cells[0].Style.Alignment = r.Cells[1].Style.Alignment = r.Cells[2].Style.Alignment = DataGridViewContentAlignment.MiddleRight; r.Cells[0].Style.Font = r.Cells[1].Style.Font = r.Cells[2].Style.Font = fontscaled; } i++; } } } } dataGridViewSuits.Update(); extPanelDataGridViewScrollSuits.ResumeLayout(); dataGridViewSuits.Sort(sortcolprev, (sortorderprev == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewSuits.Columns[sortcolprev.Index].HeaderCell.SortGlyphDirection = sortorderprev; if (firstline >= 0 && firstline < dataGridViewSuits.RowCount) { dataGridViewSuits.SafeFirstDisplayedScrollingRowIndex(firstline); } }
public bool Suits(Suits suit) => SuitList.Any(x => x == suit);