C# 클래스 BrightIdeasSoftware.Generator

The Generator class provides methods to dynamically create columns for an ObjectListView based on the characteristics of a given collection of model objects.

For a given type, a Generator can create columns to match the public properties of that type. The generator can consider all public properties or only those public properties marked with [OLVColumn] attribute.

상속: IGenerator
파일 보기 프로젝트 열기: soywiz/cspspemu

공개 메소드들

메소드 설명
GenerateAndReplaceColumns ( ObjectListView olv, Type type, bool allProperties ) : void

Generate columns into the given ObjectListView that come from the given model object type.

GenerateColumns ( Type type ) : IList

Generate a list of OLVColumns based on the public properties of the given type that have a OLVColumn attribute.

GenerateColumns ( Type type, bool allProperties ) : IList

Generate a list of OLVColumns based on the attributes of the given type If allProperties to true, all public properties will have a matching column generated. If allProperties is false, only properties that have a OLVColumn attribute will have a column generated.

GenerateColumns ( ObjectListView olv, IEnumerable enumerable ) : void

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.

GenerateColumns ( ObjectListView olv, IEnumerable enumerable, bool allProperties ) : void

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.

GenerateColumns ( ObjectListView olv, Type type ) : void

Generate columns into the given ObjectListView that come from the public properties of the given model object type.

GenerateColumns ( ObjectListView olv, Type type, bool allProperties ) : void

Generate columns into the given ObjectListView that come from the public properties of the given model object type.

MakeColumnFromPropertyDescriptor ( PropertyDescriptor pd ) : OLVColumn

Make a column from the given PropertyDescriptor

PostCreateColumns ( ObjectListView olv ) : void

Post process columns after creating them and adding them to the AllColumns collection.

보호된 메소드들

메소드 설명
ConfigurePossibleBooleanColumn ( OLVColumn column, Type propertyType ) : void

Configure the given column to show a checkbox if appropriate

DisplayNameToColumnTitle ( string displayName ) : string

Convert a property name to a displayable title.

GenerateChildrenDelegates ( TreeListView tlv, PropertyInfo pinfo ) : void

Generate CanExpand and ChildrenGetter delegates from the given property.

MakeColumn ( string aspectName, string title, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn

Create a column.

MakeColumn ( string aspectName, string title, bool editable, Type propertyType, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn
MakeColumnFromAttribute ( PropertyInfo pinfo, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn

Create a column from the given PropertyInfo and OLVColumn attribute

MakeColumnFromPropertyInfo ( PropertyInfo pinfo ) : OLVColumn

Make a column from the given PropertyInfo

ReplaceColumns ( ObjectListView olv, IList columns ) : void

Replace all the columns in the given listview with the given list of columns.

TryGenerateChildrenDelegates ( TreeListView tlv, Type type ) : void

If this given type has an property marked with [OLVChildren], make delegates that will traverse that property as the children of an instance of the model

메소드 상세

ConfigurePossibleBooleanColumn() 보호된 메소드

Configure the given column to show a checkbox if appropriate
protected ConfigurePossibleBooleanColumn ( OLVColumn column, Type propertyType ) : void
column OLVColumn
propertyType System.Type
리턴 void

DisplayNameToColumnTitle() 보호된 메소드

Convert a property name to a displayable title.
protected DisplayNameToColumnTitle ( string displayName ) : string
displayName string
리턴 string

GenerateAndReplaceColumns() 공개 메소드

Generate columns into the given ObjectListView that come from the given model object type.
public GenerateAndReplaceColumns ( ObjectListView olv, Type type, bool allProperties ) : void
olv ObjectListView The ObjectListView to modify
type System.Type The model type whose attributes will be considered.
allProperties bool Will columns be generated for properties that are not marked with [OLVColumn].
리턴 void

GenerateChildrenDelegates() 보호된 메소드

Generate CanExpand and ChildrenGetter delegates from the given property.
protected GenerateChildrenDelegates ( TreeListView tlv, PropertyInfo pinfo ) : void
tlv TreeListView
pinfo System.Reflection.PropertyInfo
리턴 void

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

GenerateColumns() 공개 메소드

Generate a list of OLVColumns based on the attributes of the given type If allProperties to true, all public properties will have a matching column generated. If allProperties is false, only properties that have a OLVColumn attribute will have a column generated.
public GenerateColumns ( Type type, bool allProperties ) : IList
type System.Type
allProperties bool Will columns be generated for properties that are not marked with [OLVColumn].
리턴 IList

GenerateColumns() 공개 정적인 메소드

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.
public static GenerateColumns ( ObjectListView olv, IEnumerable enumerable ) : void
olv ObjectListView The ObjectListView to modify
enumerable IEnumerable The collection whose first element will be used to generate columns.
리턴 void

GenerateColumns() 공개 정적인 메소드

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.
public static GenerateColumns ( ObjectListView olv, IEnumerable enumerable, bool allProperties ) : void
olv ObjectListView The ObjectListView to modify
enumerable IEnumerable The collection whose first element will be used to generate columns.
allProperties bool Will columns be generated for properties that are not marked with [OLVColumn].
리턴 void

GenerateColumns() 공개 정적인 메소드

Generate columns into the given ObjectListView that come from the public properties of the given model object type.
public static GenerateColumns ( ObjectListView olv, Type type ) : void
olv ObjectListView The ObjectListView to modify
type System.Type The model type whose attributes will be considered.
리턴 void

GenerateColumns() 공개 정적인 메소드

Generate columns into the given ObjectListView that come from the public properties of the given model object type.
public static GenerateColumns ( ObjectListView olv, Type type, bool allProperties ) : void
olv ObjectListView The ObjectListView to modify
type System.Type The model type whose attributes will be considered.
allProperties bool Will columns be generated for properties that are not marked with [OLVColumn].
리턴 void

MakeColumn() 보호된 메소드

Create a column.
protected MakeColumn ( string aspectName, string title, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn
aspectName string
title string
attr BrightIdeasSoftware.OLVColumnAttribute
리턴 OLVColumn

MakeColumn() 보호된 메소드

protected MakeColumn ( string aspectName, string title, bool editable, Type propertyType, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn
aspectName string
title string
editable bool
propertyType System.Type
attr BrightIdeasSoftware.OLVColumnAttribute
리턴 OLVColumn

MakeColumnFromAttribute() 보호된 메소드

Create a column from the given PropertyInfo and OLVColumn attribute
protected MakeColumnFromAttribute ( PropertyInfo pinfo, BrightIdeasSoftware.OLVColumnAttribute attr ) : OLVColumn
pinfo System.Reflection.PropertyInfo
attr BrightIdeasSoftware.OLVColumnAttribute
리턴 OLVColumn

MakeColumnFromPropertyDescriptor() 공개 메소드

Make a column from the given PropertyDescriptor
public MakeColumnFromPropertyDescriptor ( PropertyDescriptor pd ) : OLVColumn
pd System.ComponentModel.PropertyDescriptor
리턴 OLVColumn

MakeColumnFromPropertyInfo() 보호된 메소드

Make a column from the given PropertyInfo
protected MakeColumnFromPropertyInfo ( PropertyInfo pinfo ) : OLVColumn
pinfo System.Reflection.PropertyInfo
리턴 OLVColumn

PostCreateColumns() 공개 메소드

Post process columns after creating them and adding them to the AllColumns collection.
public PostCreateColumns ( ObjectListView olv ) : void
olv ObjectListView
리턴 void

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

TryGenerateChildrenDelegates() 보호된 메소드

If this given type has an property marked with [OLVChildren], make delegates that will traverse that property as the children of an instance of the model
protected TryGenerateChildrenDelegates ( TreeListView tlv, Type type ) : void
tlv TreeListView
type System.Type
리턴 void