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; } }
/// <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, "(装備不可)" })); } } }
/// <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; } }
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); } } }