Beispiel #1
0
        /// <summary>
        /// Attaches the SmoothStreamingMediaElement to the diagnostic component so it can be monitored.
        /// It is recommended that you do not call this directly and instead use AttachToSMF
        /// </summary>
        /// <param name="element">An instance of SSME</param>
        internal void AttachToMediaElement(SmoothStreamingMediaElement element)
        {
            // clean up the old media element just in case
            if (IsAttached)
            {
                DetachFromMediaElement();
            }

            // start logging agent if it hasn't been already
            if (!LoggingService.Current.IsSessionStarted)
            {
                LoggingService.Current.StartSession();
            }

            ssme           = element;
            ssme.Unloaded += ssme_Unloaded;

            healthMonitor = new HealthMonitor(DiagConfig);
            healthMonitor.Attach(ssme);
            healthMonitorLogger.AttachMonitor(healthMonitor);

            IsAttached = true;
        }