Exemplo n.º 1
0
        /// <summary>
        /// Uses <see cref="DVBCommon.CloseDevice"/> to close the current device.
        /// </summary>
        /// <exception cref="DVBException">
        /// Will be called if <see cref="m_MustClose"/> is not set.
        /// </exception>
        public void CloseDevice()
        {
            // Check it
            if (!m_MustClose)
            {
                throw new DVBException("No Device open");
            }

            // Once
            m_MustClose = false;

            // Process
            DVBCommon.CloseDevice();

            // Time to cleanup directories
            foreach (var dir in m_Directories)
            {
                if (dir.Exists)
                {
                    dir.Delete(true);
                }
            }

            // Forget about it all
            m_Directories.Clear();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Open the indicated device using <see cref="DVBCommon.OpenDevice"/>.
        /// </summary>
        /// <param name="lIndex">Zero-based index of the device.</param>
        /// <param name="sApp">Name of the current application - may be null.</param>
        /// <param name="bNoNet">[Not (yet) known]</param>
        /// <exception cref="DVBException">
        /// Thrown when <see cref="m_MustClose"/> is set.
        /// </exception>
        public void OpenDevice(int lIndex, string sApp, bool bNoNet)
        {
            // Already did it
            if (m_MustClose)
            {
                throw new DVBException("Must close Device first");
            }

            // Forward
            DVBCommon.OpenDevice(lIndex, sApp, bNoNet);

            // Remember
            m_MustClose = true;
        }