Microsoft.WindowsAzure.CAT.ServiceBusExplorer.ListenerControl.StopListener C# (CSharp) Method

StopListener() private method

private StopListener ( ) : Task
return Task
        private async Task StopListener()
        {
            lock (this)
            {
                stopping = true;
            }
            if (stopLog != null)
            {
                await stopLog();
            }
            if (timer != null)
            {
                timer.Stop();
                timer.Dispose();
                timer = null;
            }
            dateTime = DateTime.MinValue;
            if (cancellationTokenSource != null)
            {
                cancellationTokenSource.Cancel();
            }
            if (queueClient != null)
            {
                queueClient.Close();
                queueClient = null;
            }
            if (subscriptionClient != null)
            {
                subscriptionClient.Close();
                subscriptionClient = null;
            }
            lock (this)
            {
                stopping = false;
            }
        }
ListenerControl