コード例 #1
0
        /// <summary>
        /// 获取数据写入器中指定键的值的类型。
        /// </summary>
        /// <typeparam name="TKey">键类型</typeparam>
        /// <param name="dataWriter">数据写入器</param>
        /// <param name="key">指定键</param>
        /// <returns>返回一个类型</returns>
        public static Type GetItemType <TKey>(IDataWriter <TKey> dataWriter, TKey key)
        {
            var auxiliary = new AuxiliaryValueRW();

            dataWriter.OnWriteValue(key, auxiliary);

            return(auxiliary.GetValueType());
        }
コード例 #2
0
        /// <summary>
        /// 获取数据读写器中指定键的值的类型。
        /// </summary>
        /// <typeparam name="TKey">键类型</typeparam>
        /// <param name="dataRW">数据读写器</param>
        /// <param name="key">指定键</param>
        /// <returns>返回一个类型</returns>
        public static Type GetItemType <TKey>(IDataRW <TKey> dataRW, TKey key)
        {
            var auxiliary = new AuxiliaryValueRW();

            dataRW.OnReadValue(key, auxiliary);

            return(auxiliary.GetValueType());
        }