本文整理匯總了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;
}