1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.ComponentModel;
- using System.Globalization;
- namespace CustomControls.Pattern
- {
- /// <summary>
- /// Scripts类型转换
- /// </summary>
- public class PatternScriptsTypeConverter : ExpandableObjectConverter
- {
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if (destinationType == typeof(string) && value is XRPatternScripts) { return "(Pattern Scripts)"; }
- return base.ConvertTo(context, culture, value, destinationType);
- }
- }
- /// <summary>
- /// CodeOptions类型转化
- /// </summary>
- public class CodeOptionsTypeConverter : ExpandableObjectConverter
- {
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if (destinationType == typeof(string) && value is CodeOptions) { return "(Options)"; }
- return base.ConvertTo(context, culture, value, destinationType);
- }
- }
- }
|