Microsoft.SqlServer.TDS.SessionState.TDSSessionStateUserOptionsOption.Inflate C# (CSharp) Méthode

Inflate() public méthode

Inflate from stream
public Inflate ( Stream source ) : bool
source Stream
Résultat bool
        public override bool Inflate(Stream source)
        {
            // Reset inflation size
            InflationSize = 0;

            // NOTE: state ID is skipped because it is read by the construction factory

            // Read the value
            byte[] value = InflateValue(source);

            // First 4 bytes are flags
            int userOptions = BitConverter.ToInt32(value, 0);

            // Next 4 bytes are masks
            int userOptionsMask = BitConverter.ToInt32(value, 4);

            // Next byte are option user options
            int optionalUserOptions = (int)value[8];

            // OPT_ANSI_WARNINGS
            AnsiWarnings = (userOptions & OPT_ANSI_WARNINGS) != 0;

            // OPT_ANSI_NULLS
            AnsiNulls = (userOptions & OPT_ANSI_NULLS) != 0;

            // OPT_CURSOR_COMMIT_CLOSE
            CursorCloseOnCommit = (userOptions & OPT_CURSOR_COMMIT_CLOSE) != 0;

            // OPT_QUOTEDIDENT
            QuotedIdentifier = (userOptions & OPT_QUOTEDIDENT) != 0;

            // OPT_CATNULL
            ConcatNullYieldsNull = (userOptions & OPT_CATNULL) != 0;

            // OPT_ANSINULLDFLTON - check the mask first
            if ((userOptionsMask & OPT_ANSINULLDFLTON) != 0)
            {
                // Check the but
                AnsiNullDefaultOn = (userOptions & OPT_ANSINULLDFLTON) != 0;
            }
            else
            {
                // Not set
                AnsiNullDefaultOn = false;
            }

            // OPT_ANSI_PADDING
            AnsiPadding = (userOptions & OPT_ANSI_PADDING) != 0;

            // OPT_ARITHABORT
            ArithAbort = (userOptions & OPT_ARITHABORT) != 0;

            // OPT_NUMEABORT
            NumericRoundAbort = (userOptions & OPT_NUMEABORT) != 0;

            // OPT_XACTABORT
            TransactionAbortOnError = (userOptions & OPT_XACTABORT) != 0;

            // OPT_NOCOUNT
            NoCount = (userOptions & OPT_NOCOUNT) != 0;

            // OPT_ARITHIGN
            ArithIgnore = (userOptions & OPT_ARITHIGN) != 0;

            // OPT2_IMPLICIT_XACT
            ImplicitTransactions = (optionalUserOptions & OPT2_IMPLICIT_XACT) != 0;

            // Inflation is complete
            return true;
        }
    }