当前位置: 首页>>代码示例>>C#>>正文


C# ListView.Add方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:cyecp,项目名称:moonsharp,代码行数:9,代码来源:ValueBrowser.cs

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

            }
开发者ID:lscyane,项目名称:KCBr,代码行数:29,代码来源:FormShipDetail.cs

示例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;

                }

            }
开发者ID:lscyane,项目名称:KCBr,代码行数:36,代码来源:FormShipDetail.cs

示例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);
                }
            }
        }
开发者ID:eakova,项目名称:resizer,代码行数:61,代码来源:PhotoGalleryIntegrationRule.cs


注:本文中的System.Windows.Forms.ListView.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。