Exemple #1
0
        public void Unsubscribe()
        {
            IFileSystemChangesNotifierCallback caller = OperationContext.Current.GetCallbackChannel <IFileSystemChangesNotifierCallback>();

            lock (_lock)
            {
                if (_subscribers.Remove(caller))
                {
                    Logger.LogInformation("Subscribers: " + _subscribers.Count);
                }
            }
        }
Exemple #2
0
        public void Subscribe()
        {
            IFileSystemChangesNotifierCallback caller = OperationContext.Current.GetCallbackChannel <IFileSystemChangesNotifierCallback>();

            if (caller == null)
            {
                return;
            }

            if (_subscribers.Contains(caller))
            {
                return;
            }

            lock (_lock)
            {
                if (_subscribers.Add(caller))
                {
                    Logger.LogInformation("Subscribers: " + _subscribers.Count);
                }
            }
        }