csharp System.ComponentModel.TypeConverter类(方法)实例源码

下面列出了csharp System.ComponentModel.TypeConverter 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.ComponentMode   
[TypeConverter(typeof(MyClassConverter))]
 public class MyClass {
    // Insert code here.
}

作者:.NET开发    项目:System.ComponentMode   
public MyPropertyEnum MyProperty {
    set {
       // Checks to see if the value passed is valid.
       if (!TypeDescriptor.GetConverter(typeof(MyPropertyEnum)).IsValid(value)) {
          throw new ArgumentException();
       }
       // The value is valid. Insert code to set the property.
    }
 }

作者:.NET开发    项目:System.ComponentMode   
foreach(Color c in TypeDescriptor.GetConverter(typeof(Color)).GetStandardValues()) {
    Console.WriteLine(TypeDescriptor.GetConverter(c).ConvertToString(c));
 }


问题


面经


文章

微信
公众号

扫码关注公众号