本文整理汇总了C#中Library.List.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# List.Insert方法的具体用法?C# List.Insert怎么用?C# List.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library.List
的用法示例。
在下文中一共展示了List.Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckLocation
private static void CheckLocation(Location location, Location seed, HashSet<Location> alreadyChecked, List<Location> todoList)
{
if (location != null && !location.Marked)
{
if (!alreadyChecked.Contains(location) && !todoList.Contains(location))
{
if (seed.Color.Equals(location.Color))
{
todoList.Insert(0, location);
}
else
{
todoList.Add(location);
}
}
}
}
示例2: SetupUILanguage
private void SetupUILanguage()
{
string selected = null;
List<string> list = new List<string>();
string configuredLangId = OMLSettings.UILanguage;
foreach (var availableCulture in I18n.AvailableCultures)
{
string name = availableCulture.TextInfo.ToTitleCase(availableCulture.NativeName);
if (string.CompareOrdinal(availableCulture.Name, configuredLangId) == 0)
{
selected = name;
}
list.Add(name);
}
list.Sort((a, b) => string.Compare(a, b, true, Thread.CurrentThread.CurrentCulture));
list.Insert(0, "Use system language");
if (string.IsNullOrEmpty(selected)) selected = list[0];
_uiLanguage.Options = list;
_uiLanguage.Chosen = selected;
}
示例3: WriteSizeShort
/// <summary>
/// Add two bytes after the header label for the size
/// </summary>
/// <param name="list"></param>
public static void WriteSizeShort(List<byte> list)
{
int value = list.Count - 2;
byte b0 = (byte)value;
byte b1 = (byte)(value >> 8);
list.Insert(2, b0);
list.Insert(3, b1);
}
示例4: GetDescendants
/// <summary>子孫ノードを取得する。
/// </summary>
/// <param name="node">ツリーノードオブジェクト。</param>
/// <returns>子孫ノードの配列。</returns>
public static TreeNode[] GetDescendants(this TreeNode node)
{
var list = new List<TreeNode>(TreeViewUtility.GetDescendants(node.Nodes));
list.Insert(0, node);
return list.ToArray();
}
示例5: WriteSizeInt
public static void WriteSizeInt(List<byte> list)
{
int value = list.Count - 2;
byte[] byteArray = BitConverter.GetBytes(value);
list.Insert(2, byteArray[0]);
list.Insert(3, byteArray[1]);
list.Insert(4, byteArray[2]);
list.Insert(5, byteArray[3]);
}