コード例 #1
0
        /// <summary>
        /// Get a DataExchange object for the passed in Class
        /// </summary>
        /// <param name="clazz">The class to get a DataExchange object for</param>
        /// <returns>The IDataExchange object</returns>
        public IDataExchange GetDataExchangeForClass(Type clazz)
        {
            IDataExchange dataExchange = null;

            if (clazz == null)
            {
                dataExchange = _complexDataExchange;
            }
            else if (typeof(IList).IsAssignableFrom(clazz))
            {
                dataExchange = _listDataExchange;
            }
            else if (typeof(IDictionary).IsAssignableFrom(clazz))
            {
                dataExchange = _dictionaryDataExchange;
            }
            else if (_typeHandlerFactory.GetTypeHandler(clazz) != null)
            {
                dataExchange = _primitiveDataExchange;
            }
            else
            {
                dataExchange = new DotNetObjectDataExchange(clazz, this);
            }

            return(dataExchange);
        }
コード例 #2
0
        /// <summary>
        /// Get a DataExchange object for the passed in Class
        /// </summary>
        /// <param name="clazz">The class to get a DataExchange object for</param>
        /// <returns>The IDataExchange object</returns>
        public IDataExchange GetDataExchangeForClass(Type clazz)
        {
            IDataExchange dataExchange = null;
            if (clazz == null)
            {
                dataExchange = _complexDataExchange;
            }
            else if (typeof(IList).IsAssignableFrom(clazz))
            {
                dataExchange = _listDataExchange;
            }
            else if (typeof(IDictionary).IsAssignableFrom(clazz))
            {
                dataExchange = _dictionaryDataExchange;
            }
            else if (_typeHandlerFactory.GetTypeHandler(clazz) != null)
            {
                dataExchange = _primitiveDataExchange;
            }
            else
            {
                dataExchange = new DotNetObjectDataExchange(clazz, this);
            }

            return dataExchange;
        }