#region License
#endregion
#region Using Statements
using
System;
using
System.Collections;
using
System.ComponentModel;
using
System.Globalization;
#endregion
namespace
Microsoft.Xna.Framework.Design
{
public
class
RectangleConverter : MathTypeConverter
{
#region Public Constructor
public
RectangleConverter() :
base
()
{
supportStringConvert =
false
;
}
#endregion
#region Public Methods
public
override
object
ConvertTo(
ITypeDescriptorContext context,
CultureInfo culture,
object
value,
Type destinationType
) {
return
base
.ConvertTo(context, culture, value, destinationType);
}
public
override
object
CreateInstance(
ITypeDescriptorContext context,
IDictionary propertyValues
) {
return
(
object
)
new
Rectangle(
(
int
) propertyValues[
"X"
],
(
int
) propertyValues[
"Y"
],
(
int
) propertyValues[
"Width"
],
(
int
) propertyValues[
"Height"
]
);
}
#endregion
}
}