Show / Hide Table of Contents

Class MessageInColorConverter

Although its scope is public, the only practical use for this class is to facilitate storage of default or user specified MessageInColor values in application settings files.

Inheritance
System.Object
MessageInColorConverter
Namespace: WizardWrx.ConsoleStreams
Assembly: WizardWrx.ConsoleStreams.dll
Syntax
public class MessageInColorConverter : TypeConverter

Methods

| Improve this Doc View Source

CanConvertFrom(ITypeDescriptorContext, Type)

Return True if inputs of the specified type can be converted.

Declaration
public override bool CanConvertFrom(ITypeDescriptorContext pIContext, Type ptypSourceType)
Parameters
Type Name Description
ITypeDescriptorContext pIContext

This argument provides internal details about the type. Treat it as a black box.

Type ptypSourceType

This argument specifies the System.Type to be evaluated.

Returns
Type Description
System.Boolean

This method returns TRUE if ptypSourceType is typeof ( string ). Any other type returns FALSE.

| Improve this Doc View Source

ConvertFrom(ITypeDescriptorContext, System.Globalization.CultureInfo, Object)

Convert from string (the only supported source type) to MessageInColor.

Declaration
public override object ConvertFrom(ITypeDescriptorContext pIContext, System.Globalization.CultureInfo pCulture, object pobjValue)
Parameters
Type Name Description
ITypeDescriptorContext pIContext

This argument provides internal details about the type. Treat it as a black box.

System.Globalization.CultureInfo pCulture

This argument supplies a reference to the current CultureInfo object that drives many aspects of text and numeric conversions.

System.Object pobjValue

Specify the source object to be converted. Although the method signature requires this argument to be cast to Object, the only type supported is System.string.

Returns
Type Description
System.Object

Although specified as object to meet the requirements of the base class, the actual return value is expected to be a MessageInColors object.

| Improve this Doc View Source

ConvertTo(ITypeDescriptorContext, System.Globalization.CultureInfo, Object, Type)

Given a MessageInColors object, return a string representation that is suitable for storage in a standard application settings file.

Declaration
public override object ConvertTo(ITypeDescriptorContext pIContext, System.Globalization.CultureInfo pCulture, object pobjValue, Type pDestType)
Parameters
Type Name Description
ITypeDescriptorContext pIContext

This argument provides internal details about the type. Treat it as a black box.

System.Globalization.CultureInfo pCulture

This argument supplies a reference to the current CultureInfo object that drives many aspects of text and numeric conversions.

System.Object pobjValue

Although the method signature calls for an generic System.Object, this argument must actually be a MessageInColors object.

Type pDestType

The only valid value for this argument is typeof ( string ). The specification type is dictated by the signature of the ConvertTo method in the base class.

Returns
Type Description
System.Object

Although specified as object to meet the requirements of the base class, the actual return value is expected to be a System.string.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX