System.Net.NetEventSource.Fail C# (CSharp) Method

Fail() public static method

public static Fail ( object thisOrContextObject, object arg ) : void
thisOrContextObject object
arg object
return void
        public static void Fail(object thisOrContextObject, object arg) { }
        public static bool IsEnabled => false;

Usage Example

        // If ContextCopy or Identity will be used, the return value should be locked until FinishPostingAsyncOp() is called
        // or the operation has been aborted (e.g. by BeginXxx throwing).  Otherwise, this can be called with false to prevent the lock
        // object from being created.
        internal object StartPostingAsyncOp(bool lockCapture)
        {
            if (InternalPeekCompleted)
            {
                NetEventSource.Fail(this, "Called on completed result.");
            }

            DebugProtectState(true);

            _lock   = lockCapture ? new object() : null;
            _flags |= StateFlags.PostBlockStarted;
            return(_lock);
        }
All Usage Examples Of System.Net.NetEventSource::Fail