Beispiel #1
0
        private static int GetGroupId(ListViewGroup lstvwgrp)
        {
            var pi        = lstvwgrp.GetType().GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
            var tmprtnval = pi.GetValue(lstvwgrp, null);

            return((int)tmprtnval);
        }
Beispiel #2
0
 private static int? GetGroupID(ListViewGroup lstvwgrp)
 {
     int? rtnval = null;
     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 = tmprtnval as int?;
         }
     }
     return rtnval;
 }
        private static int?GetGroupID(ListViewGroup lvGroup)
        {
            int? grpId   = null;
            Type grpType = lvGroup.GetType();

            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);
        }
Beispiel #4
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);
        }
        //mxd.
        private static int GetGroupID(ListViewGroup group)
        {
            int  id        = int.MinValue;
            Type grouptype = group.GetType();

            PropertyInfo pi = grouptype.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);

            if (pi != null)
            {
                object idprop = pi.GetValue(group, null);
                if (idprop != null)
                {
                    id = (int)idprop;
                }
            }

            return(id);
        }
Beispiel #6
0
        // Get private member 'ID' of the ListViewGroup
        private static int GetGroupID(ListViewGroup lvGroup)
        {
            int  rtnval = 0;
            Type GrpTp  = lvGroup.GetType();

            if (GrpTp != null)
            {
                PropertyInfo pi = GrpTp.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
                if (pi != null)
                {
                    object tmprtnval = pi.GetValue(lvGroup, null);
                    if (tmprtnval != null)
                    {
                        rtnval = (int)tmprtnval;
                    }
                }
            }
            return(rtnval);
        }
        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);
        }
Beispiel #8
0
        private static int?GetGroupID(ListViewGroup lstvwgrp)
        {
            int?nullable = null;

            System.Type type = lstvwgrp.GetType();
            if (type != null)
            {
                PropertyInfo property = type.GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance);
                if (property == null)
                {
                    return(nullable);
                }
                object obj2 = property.GetValue(lstvwgrp, null);
                if (obj2 != null)
                {
                    nullable = obj2 as int?;
                }
            }
            return(nullable);
        }