示例#1
0
        /// <summary>
        /// Wird aufgerufen, sobald das Element angezeigt werden soll.
        /// </summary>
        /// <param name="sender">Wird ignoriert.</param>
        /// <param name="e">Wird ignoriert.</param>
        private void StreamDisplay_Load(object sender, EventArgs e)
        {
            // Create all
            List <SourceItem> items = SourceItem.CreateSortedListFromProfile(PlugIn.Profile);

            // Load
            selSource.Items.AddRange(items.ToArray());

            // Try to find the last selection
            if (null != PlugIn.LastSource)
            {
                selSource.SelectedItem = items.Find(s => s.Source.CompareTo(PlugIn.LastSource));
            }

            // Update
            selSource_SelectionChangeCommitted(selSource, EventArgs.Empty);
        }
示例#2
0
        /// <summary>
        /// Wird bei der ersten Anzeige des Dialogs aufgerufen.
        /// </summary>
        /// <param name="sender">Wird ignoriert.</param>
        /// <param name="e">Wird ignoriert.</param>
        private void DumperDialog_Load(object sender, EventArgs e)
        {
            // Load all sources
            List <SourceItem> sources = SourceItem.CreateSortedListFromProfile(PlugIn.Profile);

            // Load
            selSource.Items.AddRange(sources.ToArray());

            // Find the special sources
            SourceSelection freeSat    = PlugIn.Profile.FindSource(EIT.FreeSatEPGTriggerSource).FirstOrDefault();
            SourceSelection premDirect = PlugIn.Profile.FindSource(DirectCIT.TriggerSource).FirstOrDefault();
            SourceSelection premSport  = PlugIn.Profile.FindSource(SportCIT.TriggerSource).FirstOrDefault();

            // Map to sources
            m_DirectEPG = sources.Find(s => s.Source.CompareTo(premDirect));
            m_SportEPG  = sources.Find(s => s.Source.CompareTo(premSport));
            m_FreeSat   = sources.Find(s => s.Source.CompareTo(freeSat));

            // Delete as needed
            if (null == m_FreeSat)
            {
                // Get rid
                selType.Items.RemoveAt(m_FreeSatIndex);

                // Correct
                m_FreeSatIndex = -1;
                m_DirectIndex -= 1;
                m_SportIndex  -= 1;
            }
            if (null == m_DirectEPG)
            {
                // Get rid
                selType.Items.RemoveAt(m_DirectIndex);

                // Correct
                m_DirectIndex -= 1;
                m_SportIndex  -= 1;
            }
            if (null == m_SportEPG)
            {
                // Get rid
                selType.Items.RemoveAt(m_SportIndex);

                // Correct
                m_SportIndex -= 1;
            }

            // Start with default
            selPid.Value = WellKnownTable.GetWellKnownStream <EIT>();

            // Choose
            selSource.SelectedItem = sources.Find(s => s.Source.CompareTo(PlugIn.LastSource));
            selType.SelectedIndex  = 0;

            // Specials
            if (null == selSource.SelectedItem)
            {
                PlugIn.LastSource = null;
            }
            else if (selSource.SelectedItem == m_FreeSat)
            {
                selType.SelectedIndex = m_FreeSatIndex;
            }
            else if (selSource.SelectedItem == m_DirectEPG)
            {
                selType.SelectedIndex = m_DirectIndex;
            }
            else if (selSource.SelectedItem == m_SportEPG)
            {
                selType.SelectedIndex = m_SportIndex;
            }

            // Finish
            selType_SelectionChangeCommitted(selType, EventArgs.Empty);
        }