コード例 #1
0
 public IAsyncToken BeginAsyncOperation(string name, object tag = null)
 {
     lock (_gate)
     {
         if (_trackActiveTokens)
         {
             var token = new DiagnosticAsyncToken(this, name, tag);
             _activeDiagnosticTokens.Add(token);
             return(token);
         }
         else
         {
             return(new AsyncToken(this));
         }
     }
 }
コード例 #2
0
 public IAsyncToken BeginAsyncOperation(string name, object tag = null)
 {
     lock (_gate)
     {
         if (_trackActiveTokens)
         {
             var token = new DiagnosticAsyncToken(this, name, tag);
             _activeDiagnosticTokens.Add(token);
             return token;
         }
         else
         {
             return new AsyncToken(this);
         }
     }
 }
コード例 #3
0
        public IAsyncToken BeginAsyncOperation(string name, object tag = null, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
        {
            lock (_gate)
            {
                IAsyncToken asyncToken;
                if (_trackActiveTokens)
                {
                    var token = new DiagnosticAsyncToken(this, name, tag, filePath, lineNumber);
                    _diagnosticTokenList.Add(token);
                    asyncToken = token;
                }
                else
                {
                    asyncToken = new AsyncToken(this);
                }

                return(asyncToken);
            }
        }