Inheritance: IActivityMonitorClient
 /// <summary>
 /// forceBuggyRemove is not used here since this client is not lockable.
 /// </summary>
 void IActivityMonitorBoundClient.SetMonitor(Impl.IActivityMonitorImpl source, bool forceBuggyRemove)
 {
     if (source != null && _source != null)
     {
         throw ActivityMonitorClient.CreateMultipleRegisterOnBoundClientException(this);
     }
     if (_source != null)
     {
         _bridgeTarget.RemoveCallback(this);
         // Unregistering.
         for (int i = 0; i < _openedGroups.Count; ++i)
         {
             if (_openedGroups[i])
             {
                 _targetMonitor.CloseGroup(new ActivityLogGroupConclusion(ActivityMonitorResources.ClosedByBridgeRemoved, TagBridgePrematureClose));
             }
         }
         _openedGroups.Clear();
     }
     else
     {
         _bridgeTarget.AddCallback(this);
         _targetActualFilter = _bridgeTarget.TargetFinalFilter;
         if (_pullTargetTopicAndAutoTagsFromTarget)
         {
             source.InitializeTopicAndAutoTags(this._targetMonitor.Topic, _targetMonitor.AutoTags);
         }
     }
     _source = source;
     Interlocked.MemoryBarrier();
 }
Beispiel #2
0
 void IActivityMonitorBoundClient.SetMonitor(Impl.IActivityMonitorImpl source, bool forceBuggyRemove)
 {
     if (!forceBuggyRemove)
     {
         if (source != null && _source != null)
         {
             throw ActivityMonitorClient.CreateMultipleRegisterOnBoundClientException(this);
         }
     }
     _openGroups.Clear();
     _source = source;
 }