public static ICustomTypeDescriptor GetCustomTypeDescriptor(Type type) { ICustomTypeDescriptor descriptor = (ICustomTypeDescriptor)_descriptors[type]; if (descriptor == null) { descriptor = new CustomTypeDescriptorImpl(type); } return(descriptor); }
public static ICustomTypeDescriptor GetCustomTypeDescriptor(Type type) { var descriptor = (ICustomTypeDescriptor)_descriptors[type]; if (descriptor == null) { lock (_descriptors.SyncRoot) { descriptor = (ICustomTypeDescriptor)_descriptors[type]; if (descriptor == null) { descriptor = new CustomTypeDescriptorImpl(type); _descriptors.Add(type, descriptor); } } } return(descriptor); }
public TestClass() { _typeDescriptor = new CustomTypeDescriptorImpl(GetType()); }