コード例 #1
0
        private MP3PartInstaller GetNext3PartPackage()
        {
            // CHANGE HERE TO GET MORE 3 PARTY SOFTWARE IN THE LIST
            // TODO: Should this be in a config file maybe?!
            MP3PartInstaller mp3PartInstaller = null;

            switch (currentPackageIndex)
            {
            case 0:
                mp3PartInstaller = new MP3PartXMLTV();
                mp3PartInstaller.Init(this.mpTargetDir);
                mp3PartInstaller.ButtonAction_Changed += new MP3PartInstaller.ButtonActionHandler(ButtonAction_Changed);
                break;

            case 1:
                mp3PartInstaller = new MP3PartFFDShow();
                mp3PartInstaller.Init(this.mpTargetDir);
                mp3PartInstaller.ButtonAction_Changed += new MP3PartInstaller.ButtonActionHandler(ButtonAction_Changed);
                break;

/* not to be included at this moment.
 *                              case 2:
 *                                      mp3PartInstaller = new MP3PartVobSub();
 *                                      mp3PartInstaller.Init(this.mpTargetDir);
 *                                      mp3PartInstaller.ButtonAction_Changed += new MP3PartInstaller.ButtonActionHandler(ButtonAction_Changed);
 *                                      break;
 */
            }

            return(mp3PartInstaller);
        }
コード例 #2
0
    public MPRecommendations(string[] args)
    {
      Thread.CurrentThread.Name = "MPRecommendations";
      // READ THIS!!
      // You need to do some changes in Setup project for MediaPortal.
      // Click on the setup project solution and click Custom Actions Editor (at the toolbar above) 
      // Right click on Install and select Add Custom Action.
      // Dubbelclick on Application Folder and click on Output, then you get this under Install: "Primary output from PostSetup (Active)",			
      // then click properties on that one.. set Arguments to: "[TARGETDIR]" and InstallerClass=false (dont forget the " around [TARGETDIR])
      // if my guide sux.. read this: http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp

      InitializeComponent();
      if (args.Length == 0)
      {
        MessageBox.Show(
          "This post setup needs one argument to start.\nThe argument must be the directory where MediaPortal is installed.",
          "Argument missing", MessageBoxButtons.OK, MessageBoxIcon.Error);
        Application.Exit();
        ButtonAction_Changed(MP3PartInstaller.BUTTONACTION_CLOSE);
        return;
      }
      mpTargetDir = @args[0]; // this MUST been set in the Setup project.. "[TARGETDIR]"

      // text in app.
      this.Text = this.Text;
      this.labDescription.Text =
        "MediaPortal can use some third-party applications to enhance the user experience.\nThese packages are recommended, but are not required for MediaPortal to function.\nYou will need an active internet connection to install these.";
      this.labInfo.Text = ""; // text at bottom of the dialog..not in use!

      // CHANGE HERE TO GET MORE 3 PARTY SOFTWARE IN THE LIST ( 3st in list at this time )									
      MP3PartPanel.Controls.Clear();
      MP3PartInstaller mp3PartInstaller = new MP3PartInstaller();
      mp3PartInstaller = GetNext3PartPackage();
      MP3PartPanel.Controls.Add(mp3PartInstaller);
    }
コード例 #3
0
        public MPRecommendations(string[] args)
        {
            Thread.CurrentThread.Name = "MPRecommendations";
            // READ THIS!!
            // You need to do some changes in Setup project for MediaPortal.
            // Click on the setup project solution and click Custom Actions Editor (at the toolbar above)
            // Right click on Install and select Add Custom Action.
            // Dubbelclick on Application Folder and click on Output, then you get this under Install: "Primary output from PostSetup (Active)",
            // then click properties on that one.. set Arguments to: "[TARGETDIR]" and InstallerClass=false (dont forget the " around [TARGETDIR])
            // if my guide sux.. read this: http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp

            InitializeComponent();
            if (args.Length == 0)
            {
                MessageBox.Show(
                    "This post setup needs one argument to start.\nThe argument must be the directory where MediaPortal is installed.",
                    "Argument missing", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                ButtonAction_Changed(MP3PartInstaller.BUTTONACTION_CLOSE);
                return;
            }
            mpTargetDir = @args[0]; // this MUST been set in the Setup project.. "[TARGETDIR]"

            // text in app.
            this.Text = this.Text;
            this.labDescription.Text =
                "MediaPortal can use some third-party applications to enhance the user experience.\nThese packages are recommended, but are not required for MediaPortal to function.\nYou will need an active internet connection to install these.";
            this.labInfo.Text = ""; // text at bottom of the dialog..not in use!

            // CHANGE HERE TO GET MORE 3 PARTY SOFTWARE IN THE LIST ( 3st in list at this time )
            MP3PartPanel.Controls.Clear();
            MP3PartInstaller mp3PartInstaller = new MP3PartInstaller();

            mp3PartInstaller = GetNext3PartPackage();
            MP3PartPanel.Controls.Add(mp3PartInstaller);
        }
コード例 #4
0
        /// <summary>
        /// Next/Close/Cancel button..
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAction_Click(object sender, EventArgs e)
        {
            int buttonAction = int.Parse(btnAction.Tag.ToString());

            if (buttonAction == MP3PartInstaller.BUTTONACTION_NEXT || buttonAction == MP3PartInstaller.BUTTONACTION_INSTALLED ||
                buttonAction == MP3PartInstaller.BUTTONACTION_DONTINSTALL)
            {
                currentPackageIndex++;
                MP3PartInstaller mp3PartInstaller = GetNext3PartPackage();
                if (mp3PartInstaller != null)
                {
                    MP3PartPanel.Controls.Clear();
                    MP3PartPanel.Controls.Add(mp3PartInstaller);
                }
                else
                {
                    // No more packages.
                    // Application.Exit();
                    Application.ExitThread();
                }
            }
            else if (buttonAction == MP3PartInstaller.BUTTONACTION_INSTALL)
            {
                MP3PartInstaller mp3PartInstaller = (MP3PartInstaller)MP3PartPanel.Controls[0];
                mp3PartInstaller.Install();
            }
            else if (buttonAction == MP3PartInstaller.BUTTONACTION_CANCEL)
            {
                MP3PartInstaller mp3PartInstaller = (MP3PartInstaller)MP3PartPanel.Controls[0];
                mp3PartInstaller.Abort();
            }
            else if (buttonAction == MP3PartInstaller.BUTTONACTION_CLOSE)
            {
                Application.ExitThread();
            }
        }