當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ListViewGroup類代碼示例

本文整理匯總了C#中System.Windows.Forms.ListViewGroup的典型用法代碼示例。如果您正苦於以下問題:C# ListViewGroup類的具體用法?C# ListViewGroup怎麽用?C# ListViewGroup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ListViewGroup類屬於System.Windows.Forms命名空間,在下文中一共展示了ListViewGroup類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Windows.Forms.ListViewGroup類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。