本文整理汇总了C#中System.Windows.Forms.ListView.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.Add方法的具体用法?C# ListView.Add怎么用?C# ListView.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListView
的用法示例。
在下文中一共展示了ListView.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildTableTable
private void BuildTableTable(ListView listView, DynValue V)
{
var T = V.Table;
foreach (var kvp in T.Pairs)
{
listView.Add(kvp.Key, kvp.Value).Tag = kvp.Value;
}
}
示例2: AddSlotItems
/// <summary>
/// 装備情報を追加
/// </summary>
/// <param name="lvItems"></param>
void AddSlotItems(ListView.ListViewItemCollection lvItems)
{
for (int n = 0; n < _info.SlotNum; n++)
{
string name = string.Format("装備{0}", n + 1);
//有効スロットの場合
if (_info.SlotItem.Count > n)
{
//艦載機の場合
if (_info.SlotItem[n].Count > 0)
{
name = string.Format("装備{0} x{1}", n + 1, _info.SlotItem[n].Count);
}
lvItems.Add(new SlotItemLVItem(name,_info.SlotItem[n],_imgSlotItem));
}
else
{
lvItems.Add(new ListViewItem(new string[] { name, "(装備不可)" }));
}
}
}
示例3: AddLVItem
/// <summary>
/// 指定アイテムを追加する
/// </summary>
/// <param name="itemType">リストアイテム種別</param>
/// <param name="lvItems">追加するリストビューアイテムコレクション</param>
public void AddLVItem(string itemType, ListView.ListViewItemCollection lvItems)
{
switch (itemType)
{
case "火力":
case "対空":
case "装甲":
case "雷装":
case "回避":
case "索敵":
case "対潜":
case "HP":
case "燃料":
case "弾薬":
case "運":
case "速力":
case "射程":
var lvit = GetLVItem(itemType);
if (lvit != null)
lvItems.Add(lvit);
return;
case "装備":
AddSlotItems(lvItems);
return;
default:
throw new ArgumentOutOfRangeException(string.Format("not defined type:[{0}]",itemType));
// return;
}
}
示例4: Check
protected override void Check(ListView.ListViewItemCollection collection, string ext, RegistryKey rk, IWICBitmapDecoderInfo info)
{
DataEntry[] de = new DataEntry[] { new DataEntry("File Extension", ext)};
string progid = CheckStringValue(collection, rk, null, de);
if (!string.IsNullOrEmpty(progid))
{
using (RegistryKey r = OpenSubKey(collection, rk, "OpenWithProgids", de))
{
if (r != null)
{
if (Array.IndexOf(r.GetValueNames(), progid) < 0)
{
collection.Add(this, "Registry value is missing.", de, new DataEntry("Expected Values", progid), new DataEntry("Key", rk.ToString()));
}
}
}
using (RegistryKey r = OpenSubKey(collection, rk, string.Format(CultureInfo.InvariantCulture, "OpenWithList\\{0}", PhotoViewerDll), de))
{
}
using (RegistryKey r = OpenSubKey(collection, rk, "ShelExt\\ContextMenuHandlers\\ShellImagePreview", de))
{
CheckValue(collection, r, null, new string[] { PhotoGalleryGuid }, de);
}
using (RegistryKey r = OpenSubKey(collection, Registry.ClassesRoot, progid, new DataEntry[0]))
{
CheckStringValue(collection, r, null, de);
using (RegistryKey r1 = OpenSubKey(collection, r, "DefaultIcon", new DataEntry[0]))
{
CheckStringValue(collection, r1, null, de);
// TODO get and check icon
}
using (RegistryKey r1 = OpenSubKey(collection, r, "shell\\open\\command", new DataEntry[0]))
{
CheckValue(collection, r1, null, new string []{"%SystemRoot%\\System32\\rundll32.exe \"%ProgramFiles%\\Windows Photo Gallery\\PhotoViewer.dll\", ImageView_Fullscreen %1"}, de);
}
using (RegistryKey r1 = OpenSubKey(collection, r, "shell\\open", new DataEntry[0]))
{
CheckValue(collection, r1, "MuiVerb", new string[] { "@%ProgramFiles%\\Windows Photo Gallery\\PhotoViewer.dll,-3043" }, de);
}
using (RegistryKey r1 = OpenSubKey(collection, r, "shell\\open\\DropTarget", new DataEntry[0]))
{
CheckValue(collection, r1, "Clsid", new string[] { PhotoGalleryGuid }, de);
}
using (RegistryKey r1 = OpenSubKey(collection, r, "shell\\printto\\command", new DataEntry[0]))
{
CheckValue(collection, r1, null, new string[] { "%SystemRoot%\\System32\\rundll32.exe \"%ProgramFiles%\\Windows Photo Gallery\\PhotoViewer.dll\", ImageView_PrintTo /pt \"%1\" \"%2\" \"%3\" \"%4\"" }, de);
}
}
}
using (RegistryKey r = OpenSubKey(collection, Registry.ClassesRoot, string.Format(CultureInfo.InvariantCulture, "SystemFileAssociations\\{0}", ext), new DataEntry[0]))
{
using (RegistryKey r2 = OpenSubKey(collection, r, "ShellEx\\ContextMenuHandlers\\ShellImagePreview", de))
{
CheckValue(collection, r2, null, new string[] { PhotoGalleryGuid }, de);
}
}
}