Exemplo n.º 1
0
        /// <summary>
        /// Führt die Aufgabe aus.
        /// </summary>
        /// <returns>Gesetzt, wenn die Aufgabe synchron abgeschlossen wurde.</returns>
        bool IPlugInControl.Start()
        {
            // Be safe
            try
            {
                // New profile to use
                Profile newProfile = null;

                // Check mode
                if (optSatellite.Checked)
                {
                    // Just create
                    newProfile = new SatelliteProfile();
                }
                else if (optCable.Checked)
                {
                    // Create
                    newProfile = new CableProfile();

                    // Add placeholder location
                    newProfile.Locations.Add(new CableLocation());
                }
                else if (optTerrestrial.Checked)
                {
                    // Create
                    newProfile = new TerrestrialProfile();

                    // Add placeholder location
                    newProfile.Locations.Add(new TerrestrialLocation());
                }

                // Get the full path
                FileInfo path = new FileInfo(Path.Combine(JMS.DVB.ProfileManager.ProfilePath.FullName, txName.Text + "." + JMS.DVB.ProfileManager.ProfileExtension));

                // Store it
                newProfile.Save(path);

                // Update managers list
                DVB.ProfileManager.Refresh();

                // Prepare for selection
                m_Site.SelectProfile(txName.Text);

                // Auto-start configuration
                m_Site.SelectNextPlugIn(typeof(ProfileEditor));
            }
            catch (Exception e)
            {
                // Report
                MessageBox.Show(this, e.Message, Properties.Resources.NewProfile_Error);
            }

            // Done
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Führt die Aufgabe aus.
        /// </summary>
        /// <returns>Gesetzt, wenn die Aufgabe synchron abgeschlossen wurde.</returns>
        bool IPlugInControl.Start()
        {
            // Be safe
            try
            {
                // New profile to use
                Profile newProfile = null;

                // Check mode
                if (optSatellite.Checked)
                {
                    // Just create
                    newProfile = new SatelliteProfile();
                }
                else if (optCable.Checked)
                {
                    // Create
                    newProfile = new CableProfile();

                    // Add placeholder location
                    newProfile.Locations.Add( new CableLocation() );
                }
                else if (optTerrestrial.Checked)
                {
                    // Create
                    newProfile = new TerrestrialProfile();

                    // Add placeholder location
                    newProfile.Locations.Add( new TerrestrialLocation() );
                }

                // Get the full path
                FileInfo path = new FileInfo( Path.Combine( JMS.DVB.ProfileManager.ProfilePath.FullName, txName.Text + "." + JMS.DVB.ProfileManager.ProfileExtension ) );

                // Store it
                newProfile.Save( path );

                // Update managers list
                DVB.ProfileManager.Refresh();

                // Prepare for selection
                m_Site.SelectProfile( txName.Text );

                // Auto-start configuration
                m_Site.SelectNextPlugIn( typeof( ProfileEditor ) );
            }
            catch (Exception e)
            {
                // Report
                MessageBox.Show( this, e.Message, Properties.Resources.NewProfile_Error );
            }

            // Done
            return true;
        }