コード例 #1
0
ファイル: TypeAccessor.cs プロジェクト: epdumitru/mysqlib
        public static ICustomTypeDescriptor GetCustomTypeDescriptor(Type type)
        {
            ICustomTypeDescriptor descriptor = (ICustomTypeDescriptor)_descriptors[type];

            if (descriptor == null)
            {
                descriptor = new CustomTypeDescriptorImpl(type);
            }

            return(descriptor);
        }
コード例 #2
0
ファイル: TypeAccessor.cs プロジェクト: tuanagps/Project1
        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);
        }
コード例 #3
0
 public TestClass()
 {
     _typeDescriptor = new CustomTypeDescriptorImpl(GetType());
 }