• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITypedGettersV3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITypedGettersV3的典型用法代码示例。如果您正苦于以下问题:C# ITypedGettersV3类的具体用法?C# ITypedGettersV3怎么用?C# ITypedGettersV3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITypedGettersV3类属于命名空间,在下文中一共展示了ITypedGettersV3类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetBytesConversion

        private static long GetBytesConversion(SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData, long fieldOffset, byte[] buffer, int bufferOffset, int length, bool throwOnNull) {
            object obj = GetSqlValue( sink, getters, ordinal, metaData, null  );
            if (null == obj) {
                throw ADP.InvalidCast();
            }
            SqlBinary value = (SqlBinary) obj;

            if (value.IsNull) {
                if (throwOnNull) {
                    throw SQL.SqlNullValue();
                }
                else {
                    // return zero length in any case
                    return 0;
                }
            }

            if ( null == buffer ) {
                return value.Length;
            }

            length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength * sizeof(char), value.Length, 
                        fieldOffset, buffer.Length, bufferOffset, length );
            Array.Copy( value.Value, checked((int)fieldOffset), buffer, bufferOffset, length );
            return length;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:26,代码来源:ValueUtilsSmi.cs


示例2: SmiGettersStream

 internal SmiGettersStream(SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData)
 {
     this._sink = sink;
     this._getters = getters;
     this._ordinal = ordinal;
     this._readPosition = 0L;
     this._metaData = metaData;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SmiGettersStream.cs


示例3: SqlSequentialStreamSmi

        private long _length;           // Total length of the stream

        internal SqlSequentialStreamSmi(SmiEventSink_Default sink, ITypedGettersV3 getters, int columnIndex, long length)
        {
            _sink = sink;
            _getters = getters;
            _columnIndex = columnIndex;
            _length = length;
            _position = 0;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:10,代码来源:SqlSequentialStreamSmi.cs


示例4: character

        private int _peekedChar;        // Current peeked character (if any)

        internal SqlSequentialTextReaderSmi(SmiEventSink_Default sink, ITypedGettersV3 getters, int columnIndex, long length)
        {
            _sink = sink;
            _getters = getters;
            _columnIndex = columnIndex;
            _length = length;
            _position = 0;
            _peekedChar = -1;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:SqlSequentialTextReaderSmi.cs


示例5: GetByte

 internal static byte GetByte( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
     ThrowIfITypedGettersIsNull( sink, getters, ordinal );
     if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.Byte ) ) {
         return GetByte_Unchecked( sink, getters, ordinal );
     }
     object result = GetValue( sink, getters, ordinal, metaData, null );
     if (null == result) {
         throw ADP.InvalidCast();
     }
     return (Byte)result;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:ValueUtilsSmi.cs


示例6: SmiGettersStream

        internal SmiGettersStream( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
            Debug.Assert( null != sink );
            Debug.Assert( null != getters );
            Debug.Assert( 0 <= ordinal );
            Debug.Assert( null != metaData );

            _sink = sink;
            _getters = getters;
            _ordinal = ordinal;
            _readPosition = 0;
            _metaData = metaData;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:SmiGettersStream.cs


示例7: ParametersAvailable

 internal override void ParametersAvailable(SmiParameterMetaData[] metaData, ITypedGettersV3 paramValues) {
     if (null == _parent) {
         throw SQL.UnexpectedSmiEvent(UnexpectedEventType.ParametersAvailable);
     }
     _parent.ParametersAvailable(metaData, paramValues);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:SmiEventSink_Default.cs


示例8: GetTextReader

        internal static TextReader GetTextReader( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
            bool isDbNull = ValueUtilsSmi.IsDBNull_Unchecked(sink, getters, ordinal);

            // If a sql_variant, get the internal type
            if ((!isDbNull) && (metaData.SqlDbType == SqlDbType.Variant)) {
                metaData = getters.GetVariantType(sink, ordinal);
            }
            // If the SqlDbType is still variant, then it must contain null, so don't throw InvalidCast
            if ((metaData.SqlDbType != SqlDbType.Variant) && (!CanAccessGetterDirectly(metaData, ExtendedClrTypeCode.TextReader))) {
                throw ADP.InvalidCast();
            }

            string data;
            if (isDbNull) {
                // "null" textreader
                data = string.Empty;
            }
            else {
                // Read all data
                data = GetString_Unchecked(sink, getters, ordinal);
            }

            // Wrap in pre-built object
            return new StringReader(data);
        }
开发者ID:uQr,项目名称:referencesource,代码行数:25,代码来源:ValueUtilsSmi.cs


示例9: GetString

 internal static String GetString( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
     ThrowIfITypedGettersIsNull( sink, getters, ordinal );
     if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.String ) ) {
         return GetString_Unchecked( sink, getters, ordinal );
     }
     object obj = GetValue( sink, getters, ordinal, metaData, null  );
     if (null == obj) {
         throw ADP.InvalidCast();
     }
     return (String) obj;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:ValueUtilsSmi.cs


示例10: GetSqlString

        internal static SqlString GetSqlString( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
            SqlString result;
            if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.SqlString ) ) {
                if ( IsDBNull_Unchecked( sink, getters, ordinal ) ) {
                    result = SqlString.Null;
                }
                else {
                    String temp = GetString_Unchecked( sink, getters, ordinal );
                    result = new SqlString( temp );
                }
            }
            else if (SqlDbType.Xml == metaData.SqlDbType) {
                SqlXml xmlValue = GetSqlXml_Unchecked( sink, getters, ordinal, null );
                
                if (xmlValue.IsNull) {
                    result = SqlString.Null;
                }
                else {
                    result = new SqlString( xmlValue.Value );
                }
            }
            else {
                object obj = GetSqlValue( sink, getters, ordinal, metaData, null  );
                if (null == obj) {
                    throw ADP.InvalidCast();
                }
                result = (SqlString) obj;
            }

            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:31,代码来源:ValueUtilsSmi.cs


示例11: GetSqlBinary_Unchecked

        private static SqlBinary GetSqlBinary_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            byte[] buffer = GetByteArray_Unchecked( sink, getters, ordinal );
            return new SqlBinary( buffer );
        }
开发者ID:uQr,项目名称:referencesource,代码行数:6,代码来源:ValueUtilsSmi.cs


示例12: GetDateTime_Unchecked

        private static DateTime GetDateTime_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            DateTime result = getters.GetDateTime( sink, ordinal );
            sink.ProcessMessagesAndThrow();
            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:ValueUtilsSmi.cs


示例13: GetCharsLength_Unchecked

        private static long GetCharsLength_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            long result = getters.GetCharsLength( sink, ordinal );
            sink.ProcessMessagesAndThrow();
            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:ValueUtilsSmi.cs


示例14: GetChars_Unchecked

        internal static int GetChars_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
            Debug.Assert(ordinal >= 0, string.Format("Invalid ordinal: {0}", ordinal));
            Debug.Assert(sink != null, "Null SmiEventSink");
            Debug.Assert(getters != null, "Null getters");
            Debug.Assert(fieldOffset >= 0, string.Format("Invalid field offset: {0}", fieldOffset));
            Debug.Assert(buffer != null, "Null buffer");
            Debug.Assert(bufferOffset >= 0 && length >= 0 && bufferOffset + length <= buffer.Length, string.Format("Bad offset or length. bufferOffset: {0}, length: {1}, buffer.Length{2}", bufferOffset, length, buffer.Length));

            int result = getters.GetChars( sink, ordinal, fieldOffset, buffer, bufferOffset, length );
            sink.ProcessMessagesAndThrow();
            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:ValueUtilsSmi.cs


示例15: GetCharArray_Unchecked

        private static char[] GetCharArray_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            long length = getters.GetCharsLength( sink, ordinal );
            sink.ProcessMessagesAndThrow();
            int len = checked( (int)length );

            char[] buffer = new char[len];
            getters.GetChars( sink, ordinal, 0, buffer, 0, len );
            sink.ProcessMessagesAndThrow();
            return buffer;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:12,代码来源:ValueUtilsSmi.cs


示例16: buffer

        const int constTextBufferSize = 4096; // Size of the buffer (in chars) user to read input parameter of type TextReader       

    //
    //  User-visible semantics-laden Getter/Setter support methods
    //      These methods implement common semantics for getters & setters
    //      All access to underlying Smi getters/setters must validate parameters
    //      in these methods
    //  

        //  The idea for the getters is that there are two types associated with the field/column,
        //  the one the user asks for (implicitly via a strongly-typed getter) and the one the data 
        //  is stored in (SmiMetaData).
        //  When a strong getter is invoked, we try one of two ways to get the value
        //      1) go directly to the source for the requested type if possible
        //      2) instantiate the value based on the stored type (GetValue), then ask the Clr 
        //          to convert.
        internal static bool IsDBNull( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            return IsDBNull_Unchecked( sink, getters, ordinal );
        }
开发者ID:uQr,项目名称:referencesource,代码行数:19,代码来源:ValueUtilsSmi.cs


示例17: GetSqlSingle

        internal static SqlSingle GetSqlSingle( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
            SqlSingle result;
            if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.SqlSingle ) ) {
                if ( IsDBNull_Unchecked( sink, getters, ordinal ) ) {
                    result = SqlSingle.Null;
                }
                else {
                    Single temp = GetSingle_Unchecked( sink, getters, ordinal );
                    result = new SqlSingle( temp );
                }
            }
            else {
                object obj = GetSqlValue( sink, getters, ordinal, metaData, null  );
                if (null == obj) {
                    throw ADP.InvalidCast();
                }
                result = (SqlSingle) obj;
            }

            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:21,代码来源:ValueUtilsSmi.cs


示例18: GetSqlDecimal_Unchecked

        private static SqlDecimal GetSqlDecimal_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            SqlDecimal result = getters.GetSqlDecimal( sink, ordinal );
            sink.ProcessMessagesAndThrow();
            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:ValueUtilsSmi.cs


示例19: GetSqlXml

        internal static SqlXml GetSqlXml( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData, SmiContext context ) {
            SqlXml result;
            if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.SqlXml ) ) {
                if ( IsDBNull_Unchecked( sink, getters, ordinal ) ) {
                    result = SqlXml.Null;
                }
                else {
                    result = GetSqlXml_Unchecked( sink, getters, ordinal, context );
                }
            }
            else {
                object obj = GetSqlValue( sink, getters, ordinal, metaData, null  );
                if (null == obj) {
                    throw ADP.InvalidCast();
                }
                result = (SqlXml) obj;
            }

            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:20,代码来源:ValueUtilsSmi.cs


示例20: GetSqlMoney_Unchecked

        private static SqlMoney GetSqlMoney_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
            Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );

            Int64 temp = getters.GetInt64( sink, ordinal );
            sink.ProcessMessagesAndThrow();
            return new SqlMoney( temp, 1 /* ignored */ );
        }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:ValueUtilsSmi.cs



注:本文中的ITypedGettersV3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITypedSettersV3类代码示例发布时间:2022-05-24
下一篇:
C# ITypeSystem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap