Example #1
0
        public CodeScope(string domain, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Name is required", nameof(name));
            }
            if (string.IsNullOrWhiteSpace(domain))
            {
                throw new ArgumentException("Domain is required", nameof(domain));
            }

            _id     = Guid.NewGuid();
            _domain = domain;
            _name   = name;

            _hasException    = false;
            _extensions      = new ConcurrentDictionary <Type, ICodeScopeExtension>();
            _managedThreadID = Thread.CurrentThread.ManagedThreadId;

            CodeScopeManager.BeginScope(this);
        }
Example #2
0
 public void Dispose()
 {
     _hasException = Marshal.GetExceptionCode() != 0;
     CodeScopeManager.EndScope(this);
     OnDispose();
 }