Exemplo n.º 1
0
 public IListElementAccessor(IListEditor editor, int index, string name)
 {
     m_editor = editor;
     m_index  = index;
     Name     = name;
     if (m_editor.MemberInfo is PropertyInfo)
     {
         PropertyInfo pInfo = (PropertyInfo)m_editor.MemberInfo;
         Type = pInfo.PropertyType.GetElementType();
         if (Type == null)
         {
             if (pInfo.PropertyType.IsGenericType)
             {
                 Type = pInfo.PropertyType.GetGenericArguments()[0];
             }
         }
     }
     else
     {
         FieldInfo fInfo = (FieldInfo)m_editor.MemberInfo;
         Type = fInfo.FieldType.GetElementType();
         if (Type == null)
         {
             if (fInfo.FieldType.IsGenericType)
             {
                 Type = fInfo.FieldType.GetGenericArguments()[0];
             }
         }
     }
 }
 public IListElementAccessor(IListEditor editor, int listIndex, int index, string name)
 {
     m_editor    = editor;
     m_listIndex = listIndex;
     m_index     = index;
     Name        = name;
 }