本文整理汇总了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);
}
}
}
示例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;
}
示例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();
}
示例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));
}
}
}
}
示例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);
}
示例6: ListViewGroupCollection
ListViewGroupCollection()
{
list = new List<ListViewGroup> ();
default_group = new ListViewGroup ("Default Group");
default_group.IsDefault = true;
}
示例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 });
}
}
示例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;
}
示例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;
}
示例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;
}
示例11: LvwItem
public LvwItem(ChangeItem item, ListViewGroup grp)
{
Text = item.FileName;
SubItems.AddRange(new string[] { item.RelPath, "todo", "todo", item.Change.ToString() });
Group = grp;
}
示例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();
}
示例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();
}
示例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);
}
}
示例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;
}