GenerateColumns() публичный статический Метод

Generate a list of OLVColumns based on the public properties of the given type that have a OLVColumn attribute.
public static GenerateColumns ( Type type ) : IList
type System.Type
Результат IList
Пример #1
0
        static public void GenerateColumns(ObjectListView olv, IEnumerable enumerable)
        {
            // Generate columns based on the type of the first model in the collection and then quit
            foreach (object model in enumerable)
            {
                Generator.GenerateColumns(olv, model.GetType());
                return;
            }

            // If we reach here, the collection was empty, so we clear the list
            Generator.ReplaceColumns(olv, new List <OLVColumn>());
        }
Пример #2
0
 /// <summary>
 /// Replace all columns of the given ObjectListView with columns generated
 /// from the first member of the given enumerable. If the enumerable is
 /// empty or null, the ObjectListView will be cleared.
 /// </summary>
 /// <param name="olv">The ObjectListView to modify</param>
 /// <param name="enumerable">The collection whose first element will be used to generate columns.</param>
 static public void GenerateColumns(ObjectListView olv, IEnumerable enumerable)
 {
     Generator.GenerateColumns(olv, enumerable, false);
 }
Пример #3
0
        /// <summary>
        /// Generate columns into the given ObjectListView that come from the given
        /// model object type.
        /// </summary>
        /// <param name="olv">The ObjectListView to modify</param>
        /// <param name="type">The model type whose attributes will be considered.</param>
        static public void GenerateColumns(ObjectListView olv, Type type)
        {
            IList <OLVColumn> columns = Generator.GenerateColumns(type);

            Generator.ReplaceColumns(olv, columns);
        }