Ejemplo n.º 1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            status2.Text = "Wersja " + this.version;
            status3.Text = "Data: " + this.date;

            string detectedVersion = detectBCSVersion();

            if (detectedVersion != null)
            {
                lDetectedVersion.Text = detectedVersion;
                BCSVersion            = new Version(detectedVersion);
            }
            else
            {
                lDetectedVersion.Text = "nie wykryto";
            }

            string filename;

            string[] args = Environment.GetCommandLineArgs();
            if (args.Length > 1)
            {
                filename = args[1];
            }
            else if (open.ShowDialog() == DialogResult.OK)
            {
                filename = open.FileName;
            }
            else
            {
                Close();
                return;
            }

            bws = new Bws(filename, this);
            bws.init();
            bws.convert();

            labelFilename.Text        = filename;
            labelFilename.ToolTipText = filename;
            this.shortenFilenameLabel();

            this.fillSectionSelector(bws.getSections());
            cbNamesSection.Items.Clear();
            foreach (object i in cbSettingsSection.Items)
            {
                cbNamesSection.Items.Add(i);
            }

            // cloning Setting List returned from Bws, because we're going to extend it for version tracking purposes
            this.bwsSettings = new List <Setting>(bws.initSettings());
            this.bwsSettings.Add(new Setting("BM2ShowPlayerNames", this.xShowPlayerNames, bws, new Version(2, 0, 0), new Version(1, 3, 1)));
            this.bwsSettings.Add(new Setting("BM2GameSummary", this.xShowRecap, bws, new Version(3, 6, 0), new Version(3, 0, 1)));
            bindSettingChanges();
            bws.loadSettings();

            this.checkRecordsForSectionGroups();
            this.scoringOptionsWarning();

            tournament = this.detectTeamyTournament();
            if (tournament != null)
            {
                updateTournamentInfo(tournament);
                this.rbIMPTeams.Checked = true;
            }
            else
            {
                syncToolStrip.Visible = false;
                namesPanel.Visible    = false;
            }

            this.WindowState = FormWindowState.Normal;
        }