本文整理匯總了C#中System.ComponentModel.TypeConverter.GetStandardValuesExclusive方法的典型用法代碼示例。如果您正苦於以下問題:C# TypeConverter.GetStandardValuesExclusive方法的具體用法?C# TypeConverter.GetStandardValuesExclusive怎麽用?C# TypeConverter.GetStandardValuesExclusive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.ComponentModel.TypeConverter
的用法示例。
在下文中一共展示了TypeConverter.GetStandardValuesExclusive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ValidatorTypeConverter
/// <summary>
/// Initializes a new instance of the <see cref="ValidatorTypeConverter"/> class.
/// </summary>
/// <param name="type">Can not be null.</param>
/// <param name="typeConverter">Can be null to don't allow any conversion.</param>
public ValidatorTypeConverter(Type type, TypeConverter typeConverter)
: base(type)
{
this.typeConverter = typeConverter;
// Populate properties using TypeConverter
if (typeConverter != null)
{
StandardValues = typeConverter.GetStandardValues();
if (StandardValues != null && StandardValues.Count > 0)
{
StandardValuesExclusive = typeConverter.GetStandardValuesExclusive();
}
else
{
StandardValuesExclusive = false;
}
}
}
示例2: TypeEditorHostListBox
/// <summary>
/// Creates a new drop-down control to display the given TypeConverter
/// </summary>
/// <param name="typeConverter">The TypeConverter instance to retrieve drop-down values from</param>
/// <param name="propertyDescriptor">Property descriptor used to get/set values in the drop-down.</param>
/// <param name="instance">Instance object used to get/set values in the drop-down.</param>
protected internal TypeEditorHostListBox(TypeConverter typeConverter, PropertyDescriptor propertyDescriptor, object instance)
:
this(
typeConverter, propertyDescriptor, instance,
(typeConverter != null && typeConverter.GetStandardValuesExclusive())
? TypeEditorHostEditControlStyle.ReadOnlyEdit
: TypeEditorHostEditControlStyle.Editable)
{
}
示例3: CheckStandardValuesExclusive
public void CheckStandardValuesExclusive(bool expect, TypeConverter conv) {
bool result;
result = conv.GetStandardValuesExclusive(null);
if (result != expect) {
failed++;
if (verbose > 0) {
Console.WriteLine("{0}: GetStandardValuesExclusive expected {1}, returned {2}", conv.ToString(), expect, result);
}
}
}