本文整理汇总了C#中System.Windows.Documents.List.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# List.AddRange方法的具体用法?C# List.AddRange怎么用?C# List.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.AddRange方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeGruppenFrame
public void ChangeGruppenFrame(string finalrunde)
{
spiele = new List<Spiel>();
switch (finalrunde)
{
case "A":
spiele.AddRange(_wmController.GetFinalrundenSpiele(new DateTime(2010, 06, 26), new DateTime(2010, 06, 29)));
break;
case "V":
spiele.AddRange(_wmController.GetFinalrundenSpiele(new DateTime(2010, 07, 02), new DateTime(2010, 07, 03)));
break;
case "H":
spiele.AddRange(_wmController.GetFinalrundenSpiele(new DateTime(2010, 07, 06), new DateTime(2010, 07, 07)));
break;
case "F":
spiele.AddRange(_wmController.GetFinalrundenSpiele(new DateTime(2010, 07, 10), new DateTime(2010, 07, 11)));
break;
default:
return;
}
SetFinalrunde(finalrunde);
}
示例2: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
WindowPosition.Move(this);
var items = new List<VersionListViewItem>();
var files = new List<string>();
files.AddRange(Directory.GetFiles(Directory.GetCurrentDirectory(), "*.dll", SearchOption.TopDirectoryOnly));
files.AddRange(Directory.GetFiles(Directory.GetCurrentDirectory(), "*.exe", SearchOption.TopDirectoryOnly));
files.Sort((x, y) =>
{
return System.IO.Path.GetFileName(x).CompareTo(System.IO.Path.GetFileName(y));
});
foreach (var path in files)
{
var info = System.Diagnostics.FileVersionInfo.GetVersionInfo(path);
var item = new VersionListViewItem();
item.FileName = System.IO.Path.GetFileName(path);
item.Version = info.FileVersion;
items.Add(item);
}
foreach (var item in items)
{
_versionListView.Items.Add(item);
}
}
示例3: ConditionSettings
public ConditionSettings(ConnectionXML conn)
{
InitializeComponent();
this.connection = conn;
//this.connection.Type = ConnectionTypes.eCondition;
if (this.connection.Condition == null)
{
this.connection.Condition = new GameClasses.Condition();
this.connection.Condition.Predicates = new List<Predicate>();
}
else
{
this.txtText.Text = this.connection.Condition.Text;
}
this.dgPredicates.ItemsSource = this.connection.Condition.Predicates;
var lstItems = new List<ItemStrings>();
lstItems.AddRange(Globals.GameElements.Items);
lstItems.AddRange(Globals.GameElements.Stats);
lstItems.AddRange(Globals.GameElements.Skills);
this.dgcmbPredicateName.ItemsSource = lstItems;
List<PredicateTypeList> Dict = new List<PredicateTypeList>();
Dict.Add(new PredicateTypeList{ Key = PredicateTypes.eInventory, Value = "Inventory"});
Dict.Add(new PredicateTypeList { Key = PredicateTypes.eStat, Value = "Stat"});
Dict.Add(new PredicateTypeList{ Key = PredicateTypes.eSkill, Value = "Skill"});
this.dgcmbPredicateType.ItemsSource = Dict;
}
示例4: buildPath
// Найти все вершины диаметра
public List<int> buildPath(int u, int v)
{
List<int> ans = new List<int>();
if (p[u][v] == -1)
{
ans.Add(u);
ans.Add(v);
}
else
{
List<int> r = buildPath(u, p[u][v]);
List<int> l = buildPath(p[u][v], v);
ans.AddRange(r);
ans.AddRange(l);
}
for (int i = 0; i+1 < ans.Count;) {
if (ans[i] == ans[i + 1])
{
ans.RemoveAt(i);
}
else {
i++;
}
}
return ans;
}
示例5: Convert
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var htmlText = value as string;
if (string.IsNullOrWhiteSpace(htmlText))
return value;
var splits = Regex.Split(htmlText, "<a ");
var result = new List<Inline>();
foreach (var split in splits)
{
if (!split.StartsWith("href=\""))
{
result.AddRange(FormatText(split));
continue;
}
var match = Regex.Match(split, "^href=\"(?<url>(.+?))\" class=\".+?\">(?<text>(.*?))</a>(?<content>(.*?))$", RegexOptions.Singleline);
if (!match.Success)
{
result.Add(new Run(split));
continue;
}
var hyperlink = new Hyperlink(new Run(match.Groups["text"].Value))
{
NavigateUri = new Uri(match.Groups["url"].Value)
};
hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
result.Add(hyperlink);
result.AddRange(FormatText(match.Groups["content"].Value));
}
return result;
}
示例6: btnpool3_Click
private void btnpool3_Click(object sender, EventArgs e)
{
deck = new List<int>();
deck.AddRange(pool1);
deck.AddRange(pool3);
deck.AddRange(pool2);
iteration();
}
示例7: AddToIgnoreListButton_Click
private void AddToIgnoreListButton_Click(object sender, RoutedEventArgs e)
{
var l = new List<DatabaseObject>();
l.AddRange(_Tables.Where(el => el.IsChecked).Select(el => el.Item));
l.AddRange(_StoredProcedures.Where(el => el.IsChecked).Select(el => el.Item));
l.AddRange(_UserDefinedTableTypes.Where(el => el.IsChecked).Select(el => el.Item));
var w = new ManageIgnoreObjectWindow(l);
w.ShowDialog();
}
示例8: ReadBlocks
private static IEnumerable<string> ReadBlocks(IEnumerable<Block> blocks)
{
var result = new List<string>();
foreach (var block in blocks)
{
result.AddRange(ReadRuns(block));
result.AddRange(ReadTables(block));
}
return result;
}
示例9: LaunchWindow
public LaunchWindow()
{
string gameConfigurationFolder = "GameConfiguration";
string gameConfigurationsPath = Path.Combine(gameConfigurationFolder, "gameConfigs.json");
InitializeComponent();
if (!Directory.Exists(gameConfigurationFolder))
Directory.CreateDirectory(gameConfigurationFolder);
//Loading the last used configurations for hammer
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Hammer\General");
var configs = new List<GameConfiguration>();
//try loading json
if (File.Exists(gameConfigurationsPath))
{
string jsonLoadText = File.ReadAllText(gameConfigurationsPath);
configs.AddRange(JsonConvert.DeserializeObject<List<GameConfiguration>>(jsonLoadText));
}
//try loading from registry
if (rk != null)
{
string BinFolder = (string)rk.GetValue("Directory");
string gameData = Path.Combine(BinFolder, "GameConfig.txt");
configs.AddRange(GameConfigurationParser.Parse(gameData));
}
//finalise config loading
if (configs.Any())
{
//remove duplicates
configs = configs.GroupBy(g => g.Name).Select(grp => grp.First()).ToList();
//save
string jsonSaveText = JsonConvert.SerializeObject(configs, Formatting.Indented);
File.WriteAllText(gameConfigurationsPath, jsonSaveText);
if (configs.Count == 1)
Launch(configs.First());
GameGrid.ItemsSource = configs;
}
else//oh noes
{
LaunchButton.IsEnabled = false;
WarningLabel.Content = "No Hammer configurations found. Cannot launch.";
}
}
示例10: GenerateParagraphsForReference
private IList<Block> GenerateParagraphsForReference(IEnumerable<ISbItem> itens)
{
string lastTitle = string.Empty;
List<Block> blocks = new List<Block>();
foreach (ISbItem item in itens)
{
if (item is Versiculo)
{
if (lastTitle != GetTitle(item))
{
Paragraph t = NewParagraph();
t.Style = StyleTitle;
t.Inlines.Add(new Run(GetTitle(item)));
lastTitle = GetTitle(item);
blocks.Add(t);
}
Paragraph p = NewParagraph();
p.Inlines.Add(new Run(item.Display));
blocks.Add(p);
}
else
{
blocks.AddRange(GenerateParagraphsForReference(item.Children));
}
}
return blocks;
}
示例11: SlowkaClass
public SlowkaClass()
{
slowka = new List<Slowko>();
XDocument doc = null;
IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream storageStream = null;
if(storage.FileExists("slowka.xml"))
{
storageStream = new IsolatedStorageFileStream("slowka.xml", System.IO.FileMode.Open, FileAccess.Read, storage);
doc = XDocument.Load(storageStream);
storageStream.Close();
}
else
{
doc = XDocument.Load("slowka.xml");
storageStream = new IsolatedStorageFileStream("slowka.xml", System.IO.FileMode.CreateNew, FileAccess.Write, storage);
doc.Save(storageStream);
storageStream.Close();
}
//var vSlowka = from s in XElement.Load("slowka.xml").Element("slowko").Elements() select s;
var v = from s in doc.Descendants("slowko") select new Slowko(s);
slowka.AddRange(v);
}
示例12: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//Load Images
List<string> DirectoryPaths = new List<string>();
//Search all Files in diferents formats
DirectoryPaths.AddRange(Directory.GetFiles(_collagePath, "*.jpg").ToList());
DirectoryPaths.AddRange(Directory.GetFiles(_collagePath, "*.png").ToList());
DirectoryPaths.AddRange(Directory.GetFiles(_collagePath, "*.bmp").ToList());
for(int x=0; x < DirectoryPaths.Count; x++)
{
ImgCollection.Add(ImgManger.LoadImageFromFile(DirectoryPaths[x], "", 150, 150, "Img"));
}
Lbx_Img.ItemsSource = ImgCollection;
}
示例13: ListMenu
public ListMenu(string DataPath, AppsModules Modul, ListType Type, string ModLabel)
{
InitializeComponent();
//Set Label Format
Lbl_List.Foreground = new SolidColorBrush(FontColor);
Lbl_List.FontFamily = TitleFont;
//Set Title
Lbl_List.Content = ModLabel;
//Search for the Files or Directories
if (Type == ListType.Folder)
{
//Search all Directories
DirectoryPaths = Directory.GetDirectories(DataPath).ToList();
}
else if (Type == ListType.None)
{
//Dummy
}
else
{
DirectoryPaths = new List<string>();
//Search all Files in diferents formats
for(int x=0; x < FileMgr.GetFileFormats(Type).Length; x++)
DirectoryPaths.AddRange(Directory.GetFiles(DataPath, FileMgr.GetFileFormats(Type)[x]).ToList());
}
//Copy the Option Information
CurrentModul = Modul;
SelModul = 0;
myType = Type;
}
示例14: Refresh
public void Refresh()
{
var File = FileManager.Instance.CurrentFile;
if (File == null)
{
ComboBox_Table.ItemsSource = null;
ComboBox_Member.ItemsSource = null;
}
else if (ComboBox_Table.ItemsSource != File.Members)
{
ComboBox_Table.ItemsSource = File.Members;
var list = new List<LuaMember>();
foreach (var member in File.Members)
{
if (member is LuaTable)
{
list.AddRange((member as LuaTable).Members);
}
else
{
list.Add(member);
}
}
ComboBox_Member.ItemsSource = list;
}
}
示例15: GetValue
private object GetValue(string key)
{
switch (key)
{
case StandardTableKeyNames.Text:
case StandardTableKeyNames.FullText:
return DefinitionItem.DisplayParts.JoinText();
case StandardTableKeyNames2.TextInlines:
var inlines = new List<Inline> { new Run(" ") };
inlines.AddRange(DefinitionItem.DisplayParts.ToInlines(_presenter._typeMap));
foreach (var inline in inlines)
{
inline.SetValue(TextElement.FontWeightProperty, FontWeights.Bold);
}
return inlines;
case StandardTableKeyNames2.DefinitionIcon:
return DefinitionItem.Tags.GetGlyph().GetImageMoniker();
//case StandardTableKeyNames2.TextInlines:
// // content of the bucket displayed as a rich text
// var inlines = new List<Inline>();
// inlines.Add(new Run("testing") { FontWeight = FontWeights.Bold });
// inlines.Add(new Run(": defined in "));
// return inlines;
}
return null;
}