當前位置: 首頁>>代碼示例>>C#>>正文


C# ListViewGroup.GetType方法代碼示例

本文整理匯總了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;
 }
開發者ID:vainamov,項目名稱:nUpdate,代碼行數:13,代碼來源:ExplorerListView.cs

示例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;
		}
開發者ID:hbaes,項目名稱:updateSystem.NET,代碼行數:13,代碼來源:extendedListView.cs

示例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;
 }
開發者ID:andyvand,項目名稱:ProcessHacker,代碼行數:18,代碼來源:ExtendedListView.cs

示例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;
 }
開發者ID:luowei98,項目名稱:CubePrimer,代碼行數:14,代碼來源:ListViewEx.cs

示例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;
 }
開發者ID:ndilday,項目名稱:wizard-monks,代碼行數:19,代碼來源:ListViewExpanded.cs


注:本文中的System.Windows.Forms.ListViewGroup.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。