public Form1_Main() { string iniShowsFile = Path.Combine(Parameters.myProgPath, "MyTvShowsOrganizer1.ini"); string iniCommentFile = Path.Combine(Parameters.myProgPath, "MyTvShowsComments1.ini"); if (!File.Exists(iniShowsFile)) //if not exists then this is the first run. firstrun() will create this file. { //if first run then load resource samples. Parameters.firstRun = true; FirstRun(iniShowsFile); //will open an intance of formMain to display disclaimer but firstrun will be Parameters.firstRun = false; } if (!Parameters.firstRun) //when form1_main instance in FirstRun() is called (below) this will prevent splashscreen to be opened because firstRun will be true. { //preload info from internet and store it in globals variables while splashscreen is been shown. CodHtmlWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.CodHtmlWorker_DoWork); CodHtmlWorker.RunWorkerAsync(); ////open splashScreen this.splashScreen = new SplashScreen(); this.Load += new EventHandler(HandleFormLoadInitiateSplashScreen); } InitializeComponent(); ComboBox_Searcher.SelectedIndex = 0; //initiate with 0 in case first run. //tabcontrol will be hidden by createblindcontrol this.tabControl1.ItemSize = new System.Drawing.Size(18, 1); //CloseIE CIE = new CloseIE(); //System.Threading.Thread ThreadCloseeIe = new System.Threading.Thread(CIE.CloseAllIE); //ThreadCloseeIe.Start(); this.Text = this.ProductName; if (ApplicationDeployment.IsNetworkDeployed) { this.Text += " " + "V." + AppUpdate.CurrentVer.ToString(); } else { this.Text += " " + "D." + "2000.00.00.00"; } LoadTabPage(iniShowsFile, "tabPage1"); LoadComments(iniCommentFile); ObliqueComments(); RadioButton1.Checked = true; AutoApplyTooltips(); //to force deselect textbox1. textBox1.SelectAll(); textBox1.DeselectAll(); LoadTabPage("Config.ini", "tabPage5"); Parameters.MaxNumberOfPages = Convert.ToInt16(this.textBox_Conf_NofPages.Text); if (checkBox_Conf_Backup.Checked) { BackupSavedFiles(); } AddNewShow_BrowserSize(); }
public Form_Main() { string iniShowsFile = Path.Combine(Parameters.myProgPath, "MyTvShowsOrganizer1.ini"); string iniCommentFile = Path.Combine(Parameters.myProgPath, "MyTvShowsComments1.ini"); if (!File.Exists(iniShowsFile)) //if not exists then this is the first run. firstrun() will create this file. { //if first run then load resource samples. Parameters.firstRun = true; FirstRun(iniShowsFile); //will open an intance of formMain to display disclaimer but firstrun will be Parameters.firstRun = false; } if (!Parameters.firstRun) //when form1_main instance in FirstRun() is called (below) this will prevent splashscreen to be opened because firstRun will be true. { //preload info from internet and store it in globals variables while splashscreen is been shown. CodHtmlWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.CodHtmlWorker_DoWork); CodHtmlWorker.RunWorkerAsync(); ////open splashScreen this.splashScreen = new SplashScreen(); if (Parameters.showSplash) this.Load += new EventHandler(HandleFormLoadInitiateSplashScreen); } if (Environment.OSVersion.Platform != PlatformID.Win32NT && (Environment.OSVersion.Version.Major > 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 2))) { Application.EnableVisualStyles(); //only applies that if this is an OS newer than windows 8 } //will enable 3D effect on controls for newer OS versions InitializeComponent(); SubtitlesLanguages(); HandlersConstructors(); autoCompleteResolution(); ComboBox_Searcher.SelectedIndex = 0; //initiate with 0 in case first run. //tabcontrol will be hidden by createblindcontrol this.tabControl1.ItemSize = new Size(18, 1); //CloseIE CIE = new CloseIE(); //System.Threading.Thread ThreadCloseeIe = new System.Threading.Thread(CIE.CloseAllIE); //ThreadCloseeIe.Start(); Title_Text(); LoadTabPage(iniShowsFile, "tabPage1"); LoadComments(iniCommentFile); ObliqueComments(); RadioButton1.Checked = true; AutoApplyTooltips(); //to force deselect textbox1. textBox1.SelectAll(); textBox1.DeselectAll(); LoadTabPage("Config.ini", "tabPage5"); //Parameters.webTranslatorOn = this.checkBox_TP5_TranslatorOn.Checked; Toggle_Translation(); //to applicate enables. // if (this.checkBox_TP5_TranslatorOn.Checked;) Help_WebTranslator_Contructor(); if (checkBox_TP5_Backup.Checked && !Parameters.isDebugging) BackupSavedFiles(); Parameters.MaxNumberOfPages = Convert.ToInt16(this.textBox_TP5_NofPages.Text); AddNewShow_DefineBrowserSize(); // Move form windows using Panel_title mouse events with a form that has formborderstyle=none this.panel_Title.MouseDown += Panel_Title_MouseDown; this.panel_Title.MouseMove += Panel_Title_MouseMove; }