Пример #1
0
        private void constructor()
        {
            // GUI initialization
            this.tbXbmcMovieSingleText.Suggestions.Add("%title%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%year%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%rating%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%genre%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%duration%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%mpaa%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%tagline%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%studio%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%director%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%writer%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%outline%");
            this.tbXbmcMovieSingleText.Suggestions.Add("%plot%");

            this.tbXbmcTvSingleText.Suggestions.Add("%title%");
            this.tbXbmcTvSingleText.Suggestions.Add("%episode%");
            this.tbXbmcTvSingleText.Suggestions.Add("%season%");
            this.tbXbmcTvSingleText.Suggestions.Add("%show%");
            this.tbXbmcTvSingleText.Suggestions.Add("%year%");
            this.tbXbmcTvSingleText.Suggestions.Add("%rating%");
            this.tbXbmcTvSingleText.Suggestions.Add("%duration%");
            this.tbXbmcTvSingleText.Suggestions.Add("%mpaa%");
            this.tbXbmcTvSingleText.Suggestions.Add("%studio%");
            this.tbXbmcTvSingleText.Suggestions.Add("%director%");
            this.tbXbmcTvSingleText.Suggestions.Add("%writer%");
            this.tbXbmcTvSingleText.Suggestions.Add("%plot%");

            this.tbXbmcMusicSingleText.Suggestions.Add("%title%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%artist%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%album%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%track%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%year%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%rating%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%genre%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%duration%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%disc%");
            this.tbXbmcMusicSingleText.Suggestions.Add("%lyrics%");

            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%title%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%artist%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%album%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%year%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%rating%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%genre%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%duration%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%studio%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%director%");
            this.tbXbmcMusicVideoSingleText.Suggestions.Add("%plot%");

            try
            {
                //if (File.Exists(Logging.ErrorLog))
                //{
                //    if (File.Exists(Logging.ErrorLog + Logging.OldLog))
                //    {
                //        File.Delete(Logging.ErrorLog + Logging.OldLog);
                //    }
                //    File.Move(Logging.ErrorLog, Logging.ErrorLog + Logging.OldLog);
                //}
                if (File.Exists(Logging.DebugLog))
                {
                    if (File.Exists(Logging.DebugLog + Logging.OldLog))
                    {
                        File.Delete(Logging.DebugLog + Logging.OldLog);
                    }
                    File.Move(Logging.DebugLog, Logging.DebugLog + Logging.OldLog);
                }
            }
            catch (Exception)
            { }

            Logging.Log("Current version of XbmcOniMon: " + Assembly.GetExecutingAssembly().GetName().Version.ToString());

            this.xbmcConnectionTimer       = new Timer();
            this.xbmcConnectionTimer.Tick += xbmcTryConnect;


            // Check for update
            if (Settings.Default.GeneralCheckForUpdateOnStart)
            {
                Updating.update(true);
            }

            // Check if this is a newer version. If so, do settings update
            if (Settings.Default.CallUpgrade)
            {
                Logging.Log("Trying to upgrade settings");
                Settings.Default.Upgrade();
                Settings.Default.CallUpgrade = false;
                Settings.Default.Save();
                Settings.Default.Reload();
                //this.settingsUpdate();
                Logging.Log("Settings upgraded");
                MessageBox.Show("Settings upgraded from the previous version");
            }

            this.settingsUpdate();
            this.setupSettingsChanges(this.tabOptions);

            // Setting up iMON
            Logging.Log("Setting up iMON");
            this.imon = new iMonWrapperApi();
            this.imon.StateChanged += wrapperApi_StateChanged;
            this.imon.Error        += wrapperApi_Error;
            this.imon.LogError     += wrapperApiIMonLogError;
            if (Settings.Default.GeneralDebugEnable)
            {
                this.imon.Log += wrapperApiIMonLog;
            }

            this.displayHandler = new DisplayHandler(this.imon);
            this.displayHandler.RunWorkerAsync();

            // Setting up XBMC
            this.xbmcConnectingDeletage = new XbmcConnectingDelegate(xbmcConnecting);
            this.xbmcSetup();
        }
Пример #2
0
 private void miAboutCheckForUpdates_Click(object sender, EventArgs e)
 {
     Updating.update(false);
 }