本文整理汇总了C#中System.Windows.Forms.ListViewGroup.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewGroup.GetType方法的具体用法?C# ListViewGroup.GetType怎么用?C# ListViewGroup.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListViewGroup
的用法示例。
在下文中一共展示了ListViewGroup.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetGroupId
private static int GetGroupId(ListViewGroup group)
{
var groupType = group.GetType();
{
var groupIdProperty = groupType.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance); // Include inner fields and instance members
if (groupIdProperty == null)
return -1;
var value = groupIdProperty.GetValue(group, null);
if (value != null)
return (int)value;
}
return -1;
}
示例2: GetGroupID
private static int GetGroupID(ListViewGroup lstvwgrp) {
int rtnval = -1;
Type GrpTp = lstvwgrp.GetType();
{
PropertyInfo pi = GrpTp.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
if (pi != null) {
object tmprtnval = pi.GetValue(lstvwgrp, null);
if (tmprtnval != null)
rtnval = (int) tmprtnval;
}
}
return rtnval;
}
示例3: GetGroupID
private static int? GetGroupID(ListViewGroup lvGroup)
{
int? grpId = null;
Type grpType = lvGroup.GetType();
if (grpType != null)
{
PropertyInfo pInfo = grpType.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
if (pInfo != null)
{
object tmprtnval = pInfo.GetValue(lvGroup, null);
if (tmprtnval != null)
{
grpId = tmprtnval as int?;
}
}
}
return grpId;
}
示例4: GetGroupID
private int? GetGroupID(ListViewGroup group)
{
Type GrpTp = group.GetType();
if (GrpTp != null)
{
PropertyInfo pi = GrpTp.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
if (pi != null)
{
object obj = pi.GetValue(group, null);
return obj as int?;
}
}
return null;
}
示例5: GetGroupID
private static int? GetGroupID(ListViewGroup listViewGroup)
{
int? rtnval = null;
Type groupType = listViewGroup.GetType();
if (groupType != null)
{
PropertyInfo pi = groupType.GetProperty("ID", BindingFlags.NonPublic |
BindingFlags.Instance);
if (pi != null)
{
object tmprtnval = pi.GetValue(listViewGroup, null);
if (tmprtnval != null)
{
rtnval = tmprtnval as int?;
}
}
}
return rtnval;
}