private void EnqueueTargetSysInfo(SysInfoItem sii)
        {
            QueuedAsynchronousProcessor <SysInfoItem> sysInfoProcessor = _sysInfoProcessor;

            if (sysInfoProcessor != null)
            {
                if (sysInfoProcessor.GetCount() < MaxQueuedEvents)
                {
                    sysInfoProcessor.Enqueue(sii);
                }
            }
        }
        private void EnqueueProfilerEvent(Event @event)
        {
            QueuedAsynchronousProcessor <Event> eventsProcessor = _eventsProcessor;

            if ((eventsProcessor != null) && IsProfilerEvent(@event))
            {
                if (eventsProcessor.GetCount() < MaxQueuedEvents)
                {
                    eventsProcessor.Enqueue(@event);
                }
            }
        }
        /// <summary>
        /// Set a current session for <see cref="ProfilingProgressWindowContent"/>.
        /// </summary>
        /// <param name="session">The session interface.</param>
        public void SetSession(ProfileSession session)
        {
            ClearSession(false);

            _session = session;

            session.AddListener(_sessionListener);

            _sysInfoProcessor = new QueuedAsynchronousProcessor <SysInfoItem>(ProcessTargetSysInfo);
            _eventsProcessor  = new QueuedAsynchronousProcessor <Event>(ProcessProfilerEvent);

            CaptionText.Text = Path.GetFileName(session.Configuration.TargetDll);

            LegendItemDebug.Visibility = (session.IsLiveProfiling ? Visibility.Visible : Visibility.Collapsed);
        }