• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.ListViewGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.ListViewGroup的典型用法代码示例。如果您正苦于以下问题:C# ListViewGroup类的具体用法?C# ListViewGroup怎么用?C# ListViewGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListViewGroup类属于System.Windows.Forms命名空间,在下文中一共展示了ListViewGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VariablesWindow

		public VariablesWindow(IReadOnlyDictionary<string, string> Variables)
		{
			InitializeComponent();

			ListViewGroup CurrentProjectGroup = new ListViewGroup("Current Project");
			MacrosList.Groups.Add(CurrentProjectGroup);

			ListViewGroup EnvironmentGroup = new ListViewGroup("Environment");
			MacrosList.Groups.Add(EnvironmentGroup);

			foreach(KeyValuePair<string, string> Pair in Variables)
			{
				ListViewItem Item = new ListViewItem(String.Format("$({0})", Pair.Key));
				Item.SubItems.Add(Pair.Value);
				Item.Group = CurrentProjectGroup;
				MacrosList.Items.Add(Item);
			}

			foreach(DictionaryEntry Entry in Environment.GetEnvironmentVariables())
			{
				string Key = Entry.Key.ToString();
				if(!Variables.ContainsKey(Key))
				{
					ListViewItem Item = new ListViewItem(String.Format("$({0})", Key));
					Item.SubItems.Add(Entry.Value.ToString());
					Item.Group = EnvironmentGroup;
					MacrosList.Items.Add(Item);
				}
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,代码来源:VariablesWindow.cs


示例2: FindGroup

 ListViewGroup FindGroup(Guid company_id, string group_name)
 {
     ListViewGroup grp = null;
     if ( this.lvVendors.Groups.Count == 0 )
     {
         grp = new ListViewGroup(Guid.Empty.ToString(), "");
         this.lvVendors.Groups.Add(grp);
         grp = null;
     }
     foreach (ListViewGroup g in this.lvVendors.Groups)
     {
         if (g.Header == group_name)
         {
             grp = g;
             break;
         }
     }
     if (grp == null)
     {
         if (company_id == Guid.Empty)
             grp = this.lvVendors.Groups[0];
         else
         {
             grp = new ListViewGroup(company_id.ToString(), group_name);
             this.lvVendors.Groups.Add(grp);
         }
     }
     return grp;
 }
开发者ID:Skydger,项目名称:vBudget,代码行数:29,代码来源:VendorsListForm.cs


示例3: BindFiles

        protected void BindFiles()
        {
            listFiles.Items.Clear();
            listFiles.Groups.Clear();

            foreach (var file in activeReader.Files)
            {
                var seperatorPos = file.StrName.LastIndexOf("/", System.StringComparison.Ordinal);
                if (seperatorPos <= 0) continue;

                var vdir = file.StrName.Substring(0, seperatorPos);
                var group = listFiles.Groups[vdir];

                if (@group == null)
                {
                    @group = new ListViewGroup(vdir, vdir);
                    listFiles.Groups.Add(@group);
                }

                var item = new ListViewItem(file.StrName.Substring(seperatorPos + 1)) { Tag = file, Group = @group };
                @group.Items.Add(item);
                listFiles.Items.Add(item);
            }          

            listFiles.Sort();
        }
开发者ID:sswires,项目名称:GMAD.NET,代码行数:26,代码来源:MainForm.cs


示例4: AddComps

 public void AddComps(string[] computers)
 {
     ListViewComps.Items.Clear();
     ListViewGroup OnlineGroup = new ListViewGroup("ONLINE");
     ListViewComps.Groups.Add(OnlineGroup);
     ListViewGroup OfflineGroup = new ListViewGroup("OFFLINE");
     ListViewComps.Groups.Add(OfflineGroup);
     foreach (string comp in computers)
     {
         
         string[] details = comp.Split('&');
         if (details.Length == 3)
         {
             if (details[2] == "Online")
             {
                 ListViewComps.Items.Add(new ListViewItem(details, OnlineGroup));
             }
             if (details[2] == "Offline")
             {
                 ListViewComps.Items.Add(new ListViewItem(details, OfflineGroup));
             }
         }
         
     }
 }
开发者ID:Madajo,项目名称:Wake_On_Lan,代码行数:25,代码来源:MainForm.cs


示例5: GameEntitiesList

        public GameEntitiesList()
        {
            InitializeComponent();

            foreach (Type t in typeof(Client.Game.Map.Map).Assembly.GetTypes())
            {
                string group = "";
                bool deployable = false;
                foreach (var v in Attribute.GetCustomAttributes(t, true))
                    if (v is Client.Game.Map.EditorDeployableAttribute)
                    {
                        deployable = true;
                        group = ((Client.Game.Map.EditorDeployableAttribute)v).Group;
                        break;
                    }
                if (group == null) group = "";
                ListViewGroup g;
                if(!groups.TryGetValue(group, out g))
                {
                    entitiesListView.Groups.Add(g = new ListViewGroup
                    {
                        Header = group
                    });
                    groups.Add(group, g);
                }

                if (deployable)
                    entitiesListView.Items.Add(new ListViewItem { Text = t.Name, Tag = t, Group = g });
            }
            entitiesListView.SelectedIndexChanged += new EventHandler(entitiesListView_SelectedIndexChanged);
        }
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:31,代码来源:GameEntitiesList.cs


示例6: ListViewGroupCollection

		ListViewGroupCollection()
		{
			list = new List<ListViewGroup> ();

			default_group = new ListViewGroup ("Default Group");
			default_group.IsDefault = true;
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:ListViewGroupCollection.cs


示例7: insertItem

        public void insertItem(ListViewGroup group, String category)
        {
            DataRow[] rows = mainFrm.baseAssets.getRowsbyCategory(category);
            listView1.Items.Clear();

            for (int i = 0; i < rows.Length; i++)
            {
                int id = int.Parse(rows[i]["base_id"].ToString());
                String name = rows[i]["filename"].ToString();
                String cat_name = rows[i]["main_cat"].ToString();

                String newName = "null";

                //Check to see if we have a file name, and substring it to create our new filename.
                if (name.Contains(".w3d") || name.Contains(".W3D"))
                {
                    String cutName = name.Remove(name.Length - 4);
                    newName = cutName + ".jpg";
                }

                //Add the item.
                ListViewItem listViewItem1 = new ListViewItem("ID: " + id, newName);
                listViewItem1.Group = group;
                this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1 });
            }
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:26,代码来源:BaseAssets.cs


示例8: InitializeComponent

        public ListaVendaComissão()
        {
            InitializeComponent();

            lst.Columns.Clear();
            lst.Columns.Add(colCódigoVenda);
            lst.Columns.Add(colData);
            lst.Columns.Add(colVendedor);
            lst.Columns.Add(colCliente);
            lst.Columns.Add(colComissaoPara);
            lst.Columns.Add(colSetor);
            lst.Columns.Add(colValorVenda);
            lst.Columns.Add(colValorComissão);

            EnumRegra[] tipos = (EnumRegra[]) Enum.GetValues(typeof(EnumRegra));
            hashRegraGrupo = new Dictionary<EnumRegra, ListViewGroup>(tipos.Length);

            lock (hashRegraGrupo)
            {
                foreach (EnumRegra tipo in tipos)
                {
                    ListViewGroup grupo = new ListViewGroup(tipo.ToString());
                    lst.Groups.Add(grupo);
                    hashRegraGrupo[tipo] = grupo;
                }
            }

            ordenador = new ListViewColumnSorter();
            lst.ListViewItemSorter = ordenador;
        }
开发者ID:andrepontesmelo,项目名称:imjoias,代码行数:30,代码来源:ListaVendaComissão.cs


示例9: GetState

 private static bool GetState(ListViewGroup group, LVGS state)
 {
     bool flag;
     int groupId = GetGroupId(group);
     if (groupId < 0)
     {
         return false;
     }
     IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Microsoft.Win32.LVGROUP)));
     try
     {
         Microsoft.Win32.LVGROUP.SetMask(ptr, LVGF.LVGF_NONE | LVGF.LVGF_GROUPID | LVGF.LVGF_STATE, true);
         Microsoft.Win32.LVGROUP.SetGroupId(ptr, groupId);
         Microsoft.Win32.LVGROUP.SetStateMask(ptr, state, true);
         if (((int) Windows.SendMessage(group.ListView.Handle, 0x1095, (IntPtr) groupId, ptr)) >= 0)
         {
             return ((Microsoft.Win32.LVGROUP.GetState(ptr) & state) > LVGS.LVGS_NORMAL);
         }
         flag = false;
     }
     finally
     {
         Marshal.FreeHGlobal(ptr);
     }
     return flag;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:26,代码来源:ListViewGroupExtension.cs


示例10: PropertyPane

        public PropertyPane()
        {
            InitializeComponent();

            ResetComponent();

            // Load form elements

            _buttonAddProp.Image = Properties.Resources.TagPlus;
            _buttonRemoveProp.Image = Properties.Resources.TagMinus;

            // Setup control

            _groupPredefined = new ListViewGroup("Special Properties");
            _groupInherited = new ListViewGroup("Inherited Properties");
            _groupCustom = new ListViewGroup("Custom Properties");

            _propertyList.Groups.Add(_groupPredefined);
            _propertyList.Groups.Add(_groupInherited);
            _propertyList.Groups.Add(_groupCustom);

            // Wire events

            _propertyList.SubItemClicked += PropertyListSubItemClickHandler;
            _propertyList.SubItemEndEditing += PropertyListEndEditingHandler;
            _propertyList.SelectedIndexChanged += PropertyListSelectionHandler;
            _propertyList.SubItemReset += PropertyListResetHandler;

            _buttonAddProp.Click += ButtonAddPropClickHandler;
            _buttonRemoveProp.Click += ButtonRemovePropClickHandler;
        }
开发者ID:Elof3,项目名称:Treefrog,代码行数:31,代码来源:PropertyPane.cs


示例11: LvwItem

            public LvwItem(ChangeItem item, ListViewGroup grp)
            {
                Text = item.FileName;
                SubItems.AddRange(new string[] { item.RelPath, "todo", "todo", item.Change.ToString() });

                Group = grp;
            }
开发者ID:ImranCS,项目名称:tfsx,代码行数:7,代码来源:WindowUI.cs


示例12: CreateDocument

        /// <summary>
        /// Create a new ListViewGroup and assign to the current listview
        /// </summary>
        /// <param name="doc"></param>
        public void CreateDocument( ITabbedDocument doc )
        {
            ListViewGroup group = new ListViewGroup();
            Hashtable table = new Hashtable();
            table["FileName"] = doc.FileName;
            table["Document"] = doc;
            table["Markers"]  = new List<int>();
            table["Parsed"]   = false;

            group.Header = Path.GetFileName(doc.FileName);
            group.Tag    = table;
            group.Name = doc.FileName;

            this.listView1.BeginUpdate();
            this.listView1.Groups.Add(group);
            this.listView1.EndUpdate();

            TagTimer timer = new TagTimer();
            timer.AutoReset = true;
            timer.SynchronizingObject = this;
            timer.Interval = 200;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            timer.Tag = group;
            timer.Start();
        }
开发者ID:nomilogic,项目名称:fdplugins,代码行数:29,代码来源:PluginUI.cs


示例13: FrmSeleccionFotos

        public FrmSeleccionFotos(GI.BR.Propiedades.Propiedades Propiedades)
            : this()
        {
            listView1.BeginUpdate();

            ListViewGroup lvg;

            ImageList imgList = new ImageList();
            imgList.ImageSize = new Size(100, 100);

            listView1.LargeImageList = imgList;

            ListViewItem item;

            int i = 0;
            foreach (GI.BR.Propiedades.Propiedad p in Propiedades)
            {
                lvg = new ListViewGroup("Fotos de Propiedad " + p.Codigo);
                lvg.Tag = p;
                listView1.Groups.Add(lvg);

                foreach (GI.BR.Propiedades.Galeria.Foto foto in p.GaleriaFotos)
                {

                    item = new ListViewItem(foto.Descripcion);
                    item.Tag = foto;
                    item.Group = lvg;
                    imgList.Images.Add(foto.Imagen);
                    item.ImageIndex = i++;
                    listView1.Items.Add(item);
                }
            }

            listView1.EndUpdate();
        }
开发者ID:enzoburga,项目名称:pimesoft,代码行数:35,代码来源:FrmSeleccionFotos.cs


示例14: FillUpProducts

 protected void FillUpProducts()
 {
     this.lvProducts.Items.Clear();
     this.lvProducts.Groups.Clear();
     int cur_cat = -1;
     System.Windows.Forms.ListViewGroup lvg = null;
     foreach (DataRow row in this.products.Rows)
     {
         string cat_name = "";
         int cat = -1;
         System.Windows.Forms.ListViewItem lvi = new ListViewItem();
         if (!System.Convert.IsDBNull(row["Category"]) &&
             !System.Convert.IsDBNull(row["CategoryName"]))
         {
             cat = (int)row["Category"];
             cat_name = (string)row["CategoryName"];
         }
         if (cat != cur_cat)
         {
             lvg = new System.Windows.Forms.ListViewGroup(cat_name);
             this.lvProducts.Groups.Add(lvg);
             cur_cat = cat;
         }
         lvi.Group = lvg;
         lvi.Name = ((int)row["ProductID"]).ToString();
         lvi.Text = (string)row["ProductName"];
         lvi.Tag = row;
         this.lvProducts.Items.Add(lvi);
     }
 }
开发者ID:Skydger,项目名称:vBudget,代码行数:30,代码来源:DeleteProductForm.cs


示例15: PropertyPane

        public PropertyPane()
        {
            InitializeComponent();

            ResetComponent();

            // Load form elements

            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();

            _buttonAddProp.Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons._16.tag--plus.png"));
            _buttonRemoveProp.Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons._16.tag--minus.png"));

            // Setup control

            _groupPredefined = new ListViewGroup("Predefined Properties");
            _groupCustom = new ListViewGroup("Custom Properties");

            _propertyList.Groups.Add(_groupPredefined);
            _propertyList.Groups.Add(_groupCustom);

            // Wire events

            _propertyList.SubItemClicked += PropertyListSubItemClickHandler;
            _propertyList.SubItemEndEditing += PropertyListEndEditingHandler;
            _propertyList.SelectedIndexChanged += PropertyListSelectionHandler;
            _propertyList.SubItemReset += PropertyListResetHandler;

            _buttonAddProp.Click += ButtonAddPropClickHandler;
            _buttonRemoveProp.Click += ButtonRemovePropClickHandler;
        }
开发者ID:JuliaABurch,项目名称:Treefrog,代码行数:31,代码来源:PropertyPane.cs


示例16: ToItem

		public ListViewItem ToItem(DataSet1.PlaylistRow row)
		{
			ListViewGroup in_group = null;
			string group_name = (row.artist ?? "") + " - " + (row.album ?? "");
			foreach (ListViewGroup group in listViewTracks.Groups)
			{
				if (group.Name == group_name)
				{
					in_group = group;
					break;
				}
			}
			if (in_group == null)
			{
				in_group = new ListViewGroup(group_name, group_name);
				listViewTracks.Groups.Add(in_group);
			}
			int iconIndex = _icon_mgr.GetIconIndex(new FileInfo(row.path), true);
			ListViewItem item = new ListViewItem(row.title, iconIndex);
			TimeSpan Length = TimeSpan.FromSeconds(row.length);
			string lenStr = string.Format("{0:d}.{1:d2}:{2:d2}:{3:d2}", Length.Days, Length.Hours, Length.Minutes, Length.Seconds).TrimStart('0', ':', '.');
			item.SubItems.Add(new ListViewItem.ListViewSubItem(item, lenStr));
			item.Group = in_group;
			item.Tag = row;
			return item;
		}
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:26,代码来源:Playlist.cs


示例17: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            foreach (var l in listeners)
            {
                l.Stop();
            }

            listeners.Clear();
            listView1.Groups.Clear();
            listView1.Items.Clear();

            foreach (var site in sites)
            {
                var servers = site.GetServers();

                var grp = new ListViewGroup(site.GetType().Name);
                listView1.Groups.Add(grp);

                foreach (var svc in servers)
                {
                    var item = new ListViewItem(new string[] { svc.server, svc.server_port.ToString(), svc.password, svc.method }, grp);
                    item.Tag = null;
                    listView1.Items.Add(item);
                }
            }
        }
开发者ID:john-guo,项目名称:libshadowsocks,代码行数:26,代码来源:Form1.cs


示例18: CreateItem

        public ListViewItem CreateItem(object pContainer, string strPropertyName,
            ListView lvList, ListViewGroup lvgContainer, string strDisplayString)
        {
            if(pContainer == null) throw new ArgumentNullException("pContainer");
            if(strPropertyName == null) throw new ArgumentNullException("strPropertyName");
            if(strPropertyName.Length == 0) throw new ArgumentException();
            if(lvList == null) throw new ArgumentNullException("lvList");
            if(strDisplayString == null) throw new ArgumentNullException("strDisplayString");

            Type t = pContainer.GetType();
            PropertyInfo pi = t.GetProperty(strPropertyName);
            if((pi == null) || (pi.PropertyType != typeof(bool)) ||
                (pi.CanRead == false) || (pi.CanWrite == false))
                throw new ArgumentException();

            ListViewItem lvi = new ListViewItem(strDisplayString);
            if(lvgContainer != null)
            {
                lvi.Group = lvgContainer;
                Debug.Assert(lvgContainer.Items.IndexOf(lvi) >= 0);
            }

            lvList.Items.Add(lvi);

            m_vObjects.Add(pContainer);
            m_vProperties.Add(pi);
            m_vListViewItems.Add(lvi);

            return lvi;
        }
开发者ID:elitak,项目名称:keepass,代码行数:30,代码来源:CheckedLVItemDXList.cs


示例19: GetGroupId

 private static int GetGroupId(ListViewGroup group)
 {
     if (GroupIdProperty == null)
     {
         GroupIdProperty = typeof(ListViewGroup).GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
     }
     return ((GroupIdProperty != null) ? ((int) GroupIdProperty.GetValue(group, null)) : -1);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:8,代码来源:ListViewGroupExtension.cs


示例20: IsExpandedGroup

 public bool IsExpandedGroup(ListViewGroup grp)
 {
     int? i = GetGroupID(grp);
     if (i != null)
         return GetGrpState((int)i) == Win32.GROUPSTATE.EXPANDED;
     else
         return false;
 }
开发者ID:luowei98,项目名称:CubePrimer,代码行数:8,代码来源:ListViewEx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.ListViewItem类代码示例发布时间:2022-05-26
下一篇:
C# Forms.ListView类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap