MarginsConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)

 

Converts the specified object to the converter's native type.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

public override object ConvertFrom(
	ITypeDescriptorContext context,
	CultureInfo culture,
	object value
)

Parameters

context
Type: System.ComponentModel.ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

culture
Type: System.Globalization.CultureInfo

A CultureInfo that provides the language to convert to.

value
Type: System.Object

The Object to convert.

Return Value

Type: System.Object

An Object that represents the converted value.

Exception Condition
ArgumentException

value does not contain values for all four margins. For example, "100,100,100,100" specifies 1 inch for the left, right, top, and bottom margins.

NotSupportedException

The conversion cannot be performed.

The context parameter can be used to extract additional information about the environment from which this converter is being invoked. This can be null, so always check. Also, properties on the context object can return null.

.NET Framework
Available since 1.1
Return to top
Show: