当前位置: 首页>>代码示例>>C#>>正文


C# ITypedGettersV3类代码示例

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


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


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