Пример #1
0
        public void DoTests()
        {
            try
            {
                // No special HW required for this sample
                tuningSpace = (IDVBTuningSpace2)BDAUtils.GetTuningSpace(BDANetworkType.DVBT);

                TestNetworkID();
            }
            finally
            {
                Marshal.ReleaseComObject(tuningSpace);
            }
        }
            /// <summary>
            /// Erzeugt die eigentliche Anfrage zum Wechseln der Quellgruppe.
            /// </summary>
            /// <param name="tuningSpace">Der zu verwendende Namensraum.</param>
            /// <param name="initializer">Methode zur Übertragung der aktuellen Quellgruppenparameter.</param>
            private void CreateTuneRequest(IDVBTuningSpace2 tuningSpace, Action <ILocator> initializer)
            {
                // Create from tuning space
                m_Request = tuningSpace.CreateTuneRequest();

                // Reset internally - just in case
                m_Request.ONID = -1;
                m_Request.TSID = -1;
                m_Request.SID  = -1;

                // Attach to the default locator
                var @default = tuningSpace.DefaultLocator;

                try
                {
                    // Clone the default locator
                    var locator = @default.Clone();
                    try
                    {
                        // Set it up
                        initializer?.Invoke(locator);

                        // Attach locator
                        m_Request.Locator = locator;
                    }
                    finally
                    {
                        // Detach from clone
                        BDAEnvironment.Release(ref locator);
                    }
                }
                finally
                {
                    // Detach
                    BDAEnvironment.Release(ref @default);
                }
            }