/// <summary> /// Form is shown (after it's loaded) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Tester_Shown(object sender, EventArgs e) { if (Resources.API_KEY != null && !Resources.API_KEY.Equals("")) { try { StartScreen screen = new StartScreen(); screen.StartPosition = FormStartPosition.Manual; screen.Left = (this.Left) + (this.Width / 2) - (screen.Width / 2); screen.Top = (this.Top) + (this.Height / 2) - (screen.Height / 2); DialogResult res = screen.ShowDialog(); if (res == DialogResult.OK) { ICacheProvider p = null; if (screen.CacheProvider == typeof(XmlCacheProvider)) { p = new XmlCacheProvider(screen.RootFolder); } else if (screen.CacheProvider == typeof(BinaryCacheProvider)) { p = new BinaryCacheProvider(screen.RootFolder); } if (screen.UseUserIdentifier) { InitialiseForm(screen.UserIdentifier, p); } else { InitialiseForm(null, p); } } else {//user clicked on exit -> use no userid and no caching InitialiseForm(null, null); } } catch (TvdbNotAvailableException) { MessageBox.Show("Tvdb not available, try again later"); } } else { MessageBox.Show("Please insert your api key into the project's Resources"); panelSeriesOverview.Enabled = false; tabControlTvdb.Enabled = false; } }
/// <summary> /// Form is shown (after it's loaded) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Tester_Shown(object sender, EventArgs e) { if (Resources.API_KEY != null && !Resources.API_KEY.Equals("")) { StartScreen screen = new StartScreen(); screen.StartPosition = FormStartPosition.Manual; screen.Left = (this.Left) + (this.Width / 2) - (screen.Width / 2); screen.Top = (this.Top) + (this.Height / 2) - (screen.Height / 2); DialogResult res = screen.ShowDialog(); ICacheProvider p = null; if (screen.CacheProvider == typeof(XmlCacheProvider)) { p = new XmlCacheProvider(screen.RootFolder); } else if (screen.CacheProvider == typeof(BinaryCacheProvider)) { p = new BinaryCacheProvider(screen.RootFolder); } if (res == DialogResult.Cancel) { InitialiseForm(null, p); } else { InitialiseForm(screen.UserIdentifier, p); } } else { MessageBox.Show("Please insert your api key into the project's Resources"); panelSeriesOverview.Enabled = false; tabControlTvdb.Enabled = false; } }