本文整理汇总了C#中SortableBindingList.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# SortableBindingList.Sort方法的具体用法?C# SortableBindingList.Sort怎么用?C# SortableBindingList.Sort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortableBindingList
的用法示例。
在下文中一共展示了SortableBindingList.Sort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadBoxScore
/// <summary>Loads the given box score.</summary>
/// <param name="bse">The BoxScoreEntry to load.</param>
private void loadBoxScore(BoxScoreEntry bse)
{
var bs = bse.BS;
MainWindow.TempBSE_BS = bse.BS;
FillTeamBoxScore(bs);
dtpGameDate.SelectedDate = bs.GameDate;
_curSeason = bs.SeasonNum;
//LinkInternalsToMainWindow();
chkIsPlayoff.IsChecked = bs.IsPlayoff;
calculateScoreAway();
calculateScoreHome();
pbsAwayList = new SortableBindingList<PlayerBoxScore>();
pbsHomeList = new SortableBindingList<PlayerBoxScore>();
pbsAwayList.AllowNew = true;
pbsAwayList.AllowEdit = true;
pbsAwayList.AllowRemove = true;
pbsAwayList.RaiseListChangedEvents = true;
pbsHomeList.AllowNew = true;
pbsHomeList.AllowEdit = true;
pbsHomeList.AllowRemove = true;
pbsHomeList.RaiseListChangedEvents = true;
dgvPlayersAway.ItemsSource = pbsAwayList;
dgvPlayersHome.ItemsSource = pbsHomeList;
_loading = true;
foreach (var pbs in bse.PBSList)
{
if (pbs.TeamID == bs.Team1ID)
{
pbsAwayList.Add(pbs);
}
else
{
pbsHomeList.Add(pbs);
}
}
pbsAwayList.Sort((pbs1, pbs2) => (pbs2.MINS - pbs1.MINS));
pbsHomeList.Sort((pbs1, pbs2) => (pbs2.MINS - pbs1.MINS));
try
{
cmbTeam1.SelectedItem = MainWindow.TST[bs.Team1ID].DisplayName;
cmbTeam2.SelectedItem = MainWindow.TST[bs.Team2ID].DisplayName;
}
catch
{
MessageBox.Show(
"One of the teams requested is disabled for this season. This box score is not available.\n"
+ "To be able to see this box score, enable the teams included in it.");
Close();
}
populateSeasonCombo();
pbpeList = new ObservableCollection<PlayByPlayEntry>(bse.PBPEList);
pbpeList.Sort(new PlayByPlayEntryComparerAsc());
lstPlayByPlay.ItemsSource = pbpeList;
_loading = false;
}
示例2: loadBoxScore
/// <summary>
/// Loads the given box score.
/// </summary>
/// <param name="bse">The BoxScoreEntry to load.</param>
private void loadBoxScore(BoxScoreEntry bse)
{
TeamBoxScore bs = bse.BS;
MainWindow.bs = bse.BS;
txtPTS1.Text = bs.PTS1.ToString();
txtREB1.Text = bs.REB1.ToString();
txtAST1.Text = bs.AST1.ToString();
txtSTL1.Text = bs.STL1.ToString();
txtBLK1.Text = bs.BLK1.ToString();
txtTO1.Text = bs.TOS1.ToString();
txtFGM1.Text = bs.FGM1.ToString();
txtFGA1.Text = bs.FGA1.ToString();
txt3PM1.Text = bs.TPM1.ToString();
txt3PA1.Text = bs.TPA1.ToString();
txtFTM1.Text = bs.FTM1.ToString();
txtFTA1.Text = bs.FTA1.ToString();
txtOREB1.Text = bs.OREB1.ToString();
txtFOUL1.Text = bs.FOUL1.ToString();
txtMINS1.Text = bs.MINS1.ToString();
txtPTS2.Text = bs.PTS2.ToString();
txtREB2.Text = bs.REB2.ToString();
txtAST2.Text = bs.AST2.ToString();
txtSTL2.Text = bs.STL2.ToString();
txtBLK2.Text = bs.BLK2.ToString();
txtTO2.Text = bs.TOS2.ToString();
txtFGM2.Text = bs.FGM2.ToString();
txtFGA2.Text = bs.FGA2.ToString();
txt3PM2.Text = bs.TPM2.ToString();
txt3PA2.Text = bs.TPA2.ToString();
txtFTM2.Text = bs.FTM2.ToString();
txtFTA2.Text = bs.FTA2.ToString();
txtOREB2.Text = bs.OREB2.ToString();
txtFOUL2.Text = bs.FOUL2.ToString();
txtMINS2.Text = bs.MINS2.ToString();
dtpGameDate.SelectedDate = bs.GameDate;
_curSeason = bs.SeasonNum;
//LinkInternalsToMainWindow();
chkIsPlayoff.IsChecked = bs.IsPlayoff;
calculateScoreAway();
calculateScoreHome();
pbsAwayList = new SortableBindingList<PlayerBoxScore>();
pbsHomeList = new SortableBindingList<PlayerBoxScore>();
pbsAwayList.AllowNew = true;
pbsAwayList.AllowEdit = true;
pbsAwayList.AllowRemove = true;
pbsAwayList.RaiseListChangedEvents = true;
pbsHomeList.AllowNew = true;
pbsHomeList.AllowEdit = true;
pbsHomeList.AllowRemove = true;
pbsHomeList.RaiseListChangedEvents = true;
dgvPlayersAway.ItemsSource = pbsAwayList;
dgvPlayersHome.ItemsSource = pbsHomeList;
_loading = true;
foreach (PlayerBoxScore pbs in bse.PBSList)
{
if (pbs.TeamID == bs.Team1ID)
{
pbsAwayList.Add(pbs);
}
else
{
pbsHomeList.Add(pbs);
}
}
pbsAwayList.Sort((pbs1, pbs2) => (pbs2.MINS - pbs1.MINS));
pbsHomeList.Sort((pbs1, pbs2) => (pbs2.MINS - pbs1.MINS));
try
{
cmbTeam1.SelectedItem = MainWindow.TST[bs.Team1ID].DisplayName;
cmbTeam2.SelectedItem = MainWindow.TST[bs.Team2ID].DisplayName;
}
catch
{
MessageBox.Show("One of the teams requested is disabled for this season. This box score is not available.\n" +
"To be able to see this box score, enable the teams included in it.");
Close();
}
populateSeasonCombo();
_loading = false;
}