Example #1
0
 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;
 }
		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;
		}
 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;
 }
Example #4
0
        private static int?GetGroupID(ListViewGroup lstvwgrp)
        {
            int? rtnval = null;
            Type GrpTp  = lstvwgrp.GetType();

            if (GrpTp != null)
            {
                PropertyInfo pi = GrpTp.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
                if (pi != null)
                {
                    object tmprtnval = pi.GetValue(lstvwgrp, null);
                    if (tmprtnval != null)
                    {
                        rtnval = tmprtnval as int?;
                    }
                }
            }
            return(rtnval);
        }
Example #5
0
 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;
 }
Example #6
0
 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;
 }