private static ReflectedTypeData GetTypeData(Type type, bool createIfNeeded)
        {
            ReflectedTypeData td;

            lock (_internalSyncObject)
            {
                if (!TypeData.TryGetValue(type, out td) && createIfNeeded)
                {
                    td = new ReflectedTypeData(type);
                    TypeData.Add(type, td);
                }
            }

            return(td);
        }
        /// <devdoc>
        ///     Returns the type data for the given type, or
        ///     null if there is no type data for the type yet and
        ///     createIfNeeded is false.
        /// </devdoc>
        private ReflectedTypeData GetTypeData(Type type, bool createIfNeeded) {

            ReflectedTypeData td = null;

            if (_typeData != null) {
                td = (ReflectedTypeData)_typeData[type];
                if (td != null) {
                    return td;
                }
            }

            lock (_internalSyncObject) {
                if (_typeData != null) {
                    td = (ReflectedTypeData)_typeData[type];
                }

                if (td == null && createIfNeeded) {
                    td = new ReflectedTypeData(type);
                    if (_typeData == null) {
                        _typeData = new Hashtable();
                    }
                    _typeData[type] = td;
                }
            }

            return td;
        }
        public static ReflectedPropertyCollection GetProperties(Type type)
        {
            ReflectedTypeData td = GetTypeData(type, true);

            return(td.GetProperties());
        }
 private ReflectedTypeData GetTypeData(Type type, bool createIfNeeded)
 {
     ReflectedTypeData data = null;
     if (this._typeData != null)
     {
         data = (ReflectedTypeData) this._typeData[type];
         if (data != null)
         {
             return data;
         }
     }
     lock (_internalSyncObject)
     {
         if (this._typeData != null)
         {
             data = (ReflectedTypeData) this._typeData[type];
         }
         if ((data != null) || !createIfNeeded)
         {
             return data;
         }
         data = new ReflectedTypeData(type);
         if (this._typeData == null)
         {
             this._typeData = new Hashtable();
         }
         this._typeData[type] = data;
     }
     return data;
 }
        /// <devdoc>
        ///     Returns the type data for the given type, or
        ///     null if there is no type data for the type yet and
        ///     createIfNeeded is false.
        /// </devdoc>
        private ReflectedTypeData GetTypeData(Type type, bool createIfNeeded) {

            ReflectedTypeData td = null;

            if (_typeData != null) {
                td = (ReflectedTypeData)_typeData[type];
            }

            if (td == null && createIfNeeded) {
                td = new ReflectedTypeData(type);
                if (_typeData == null) {
                    _typeData = new Hashtable();
                }
                _typeData[type] = td;
            }

            return td;
        }