System.Data.Common.ADP.MethodCalledTwice C# (CSharp) Method

MethodCalledTwice() static private method

static private MethodCalledTwice ( string method ) : InvalidOperationException
method string
return System.InvalidOperationException
        static internal InvalidOperationException MethodCalledTwice(string method)
        {
            InvalidOperationException e = new InvalidOperationException(Res.GetString(Res.ADP_CalledTwice, method));
            return e;
        }

Usage Example

Example #1
0
        internal void CompareExchangeOwner(object owner, string method)
        {
            object obj2 = Interlocked.CompareExchange(ref this._owner, null, owner);

            if (obj2 != owner)
            {
                if (obj2 != null)
                {
                    throw ADP.IncorrectAsyncResult();
                }
                throw ADP.MethodCalledTwice(method);
            }
        }
ADP