本文整理汇总了C#中System.ComponentModel.Model.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# Model.AddRange方法的具体用法?C# Model.AddRange怎么用?C# Model.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.Model
的用法示例。
在下文中一共展示了Model.AddRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateArchiveList
protected void updateArchiveList()
{
int selected_count = Games.SelectedItems.Count;
TranslationHelpers.translate(BackupSelectedGames, "BackupGames", selected_count.ToString());
if (selected_count > 0) {
BackupSelectedGames.IsEnabled = true;
PurgeButton.IsEnabled = true;
if (selected_count == 1) {
CustomBackup.IsEnabled = true;
} else {
CustomBackup.IsEnabled = false;
}
} else {
PurgeButton.IsEnabled = false;
CustomBackup.IsEnabled = false;
BackupSelectedGames.IsEnabled = false;
RestoreSelected.IsEnabled = false;
deleteGame.IsEnabled = false;
}
Model<ArchiveID, Archive> archives = new Model<ArchiveID, Archive>();
deleteGame.IsEnabled = Games.OnlyCustomGamesSelected;
archives.AddRange(Games.SelectedGamesArchives);
if (ArchiveList.DataContext != null) {
lock (ArchiveList.DataContext) {
foreach (Archive archive in (Model<ArchiveID, Archive>)ArchiveList.DataContext) {
if (!archives.containsId(archive.id))
archive.IsSelected = false;
}
}
}
ArchiveList.DataContext = archives;
ArchiveList.Model = archives;
if (archives.Count > 0) {
ArchiveColumn.MinWidth = 300;
ArchiveColumn.Width = new GridLength(2, GridUnitType.Star);
ArchiveGrid.Visibility = System.Windows.Visibility.Visible;
SelectGameLabel.Visibility = System.Windows.Visibility.Collapsed;
TranslationHelpers.translate(ArchiveCount, "NumberOfArchives", archives.Count.ToString(), gamesLst.SelectedItems.Count.ToString());
} else {
ArchiveColumn.MinWidth = 0;
ArchiveColumn.Width = new GridLength(0, GridUnitType.Pixel);
ArchiveGrid.Visibility = System.Windows.Visibility.Collapsed;
SelectGameLabel.Visibility = System.Windows.Visibility.Visible;
}
ListSplitter.Visibility = ArchiveGrid.Visibility;
updateRestoreButton();
}
示例2: updateArchiveList
protected void updateArchiveList()
{
int selected_count = gamesLst.SelectedItems.Count;
TranslationHelpers.translate(BackupSelectedGames, "BackupGames", selected_count.ToString());
if (selected_count > 0) {
BackupSelectedGames.IsEnabled = true;
PurgeButton.IsEnabled = true;
if (selected_count == 1) {
CustomBackup.IsEnabled = true;
} else {
CustomBackup.IsEnabled = false;
}
} else {
PurgeButton.IsEnabled = false;
CustomBackup.IsEnabled = false;
BackupSelectedGames.IsEnabled = false;
RestoreSelected.IsEnabled = false;
deleteGame.IsEnabled = false;
return;
}
Model<ArchiveID, Archive> archives = new Model<ArchiveID, Archive>();
deleteGame.IsEnabled = true;
foreach (GameEntry game in gamesLst.SelectedItems) {
if (game is CustomGameEntry) {
CustomGame custom = game.Game as CustomGame;
} else
deleteGame.IsEnabled = false;
archives.AddRange(game.Archives);
}
if (ArchiveList.DataContext != null) {
foreach (Archive archive in (Model<ArchiveID, Archive>)ArchiveList.DataContext) {
if (!archives.containsId(archive.id))
archive.IsSelected = false;
}
}
ArchiveList.DataContext = archives;
ArchiveList.ItemsSource = archives;
if (archives.Count > 0) {
ArchiveGrid.Visibility = System.Windows.Visibility.Visible;
TranslationHelpers.translate(ArchiveCount, "NumberOfArchives", archives.Count.ToString(), gamesLst.SelectedItems.Count.ToString());
} else {
ArchiveGrid.Visibility = System.Windows.Visibility.Collapsed;
}
}