C# Class Revit.SDK.Samples.CreateBeamSystem.CS.ParameterConverter

base class of converting types of FamilySymbol to string Code here have nothing with Revit API it's only for PropertyGrid and its SelectedObject
Inheritance: System.ComponentModel.TypeConverter
Show file Open project: AMEE/revit

Protected Properties

Property Type Description
m_hash FamilySymbol>.Dictionary

Public Methods

Method Description
CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool

whether this converter can convert an object of the given type to string

ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object

converts the Name to corresponding FamilySymbol

ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object v, Type destinationType ) : object

converts the given FamilySymbol to the Name, using the specified context and culture information

GetConvertHash ( ) : void

subclass must implement to initialize m_hash

GetStandardValues ( ITypeDescriptorContext context ) : StandardValuesCollection

returns a collection of FamilySymbol

GetStandardValuesExclusive ( ITypeDescriptorContext context ) : bool

whether the collection of standard values returned from GetStandardValues is an exclusive list of possible values

GetStandardValuesSupported ( ITypeDescriptorContext context ) : bool

returns whether this object supports a standard set of values that can be picked from a list

Protected Methods

Method Description
ParameterConverter ( ) : System

constructor initialize m_hash

Method Details

CanConvertFrom() public method

whether this converter can convert an object of the given type to string
public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext provides a format context
sourceType System.Type a Type that represents the type you want to convert from
return bool

ConvertFrom() public method

converts the Name to corresponding FamilySymbol
public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext provides a format context
culture System.Globalization.CultureInfo the CultureInfo to use as the current culture
value object the Object to convert
return object

ConvertTo() public method

converts the given FamilySymbol to the Name, using the specified context and culture information
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object v, Type destinationType ) : object
context ITypeDescriptorContext provides a format context
culture System.Globalization.CultureInfo the CultureInfo to use as the current culture
v object the Object to convert
destinationType System.Type should be string
return object

GetConvertHash() public abstract method

subclass must implement to initialize m_hash
public abstract GetConvertHash ( ) : void
return void

GetStandardValues() public method

returns a collection of FamilySymbol
public GetStandardValues ( ITypeDescriptorContext context ) : StandardValuesCollection
context ITypeDescriptorContext provides a format context
return StandardValuesCollection

GetStandardValuesExclusive() public method

whether the collection of standard values returned from GetStandardValues is an exclusive list of possible values
public GetStandardValuesExclusive ( ITypeDescriptorContext context ) : bool
context ITypeDescriptorContext provides a format context
return bool

GetStandardValuesSupported() public method

returns whether this object supports a standard set of values that can be picked from a list
public GetStandardValuesSupported ( ITypeDescriptorContext context ) : bool
context ITypeDescriptorContext provides a format context
return bool

ParameterConverter() protected method

constructor initialize m_hash
protected ParameterConverter ( ) : System
return System

Property Details

m_hash protected property

hashtable of FamilySymbol and its Name
protected Dictionary m_hash
return FamilySymbol>.Dictionary