ReplaceColumns() защищенный Метод

Replace all the columns in the given listview with the given list of columns.
protected ReplaceColumns ( ObjectListView olv, IList columns ) : void
olv ObjectListView
columns IList
Результат void
Пример #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>
        /// 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);
        }