Наследование: System.Windows.Forms.Form
Пример #1
0
        public MainForm()
        {
            instance = this;

            // Start logging
            if( File.Exists( Paths.LauncherLogFile ) ) {
                File.Delete( Paths.LauncherLogFile + ".old" );
                File.Move( Paths.LauncherLogFile, Paths.LauncherLogFile + ".old" );
            }
            Log( "---- " + DateTime.Now.ToLongDateString() + " ----" );
            Log( VersionString );

            // Set up the GUI
            InitializeComponent();
            SetToolTips();
            lOptionsStatus.Text = "";
            lToolStatus.Text = "";
            Text = VersionString;

            // hook up event handlers
            signInWorker.DoWork += SignIn;
            signInWorker.RunWorkerCompleted += OnSignInCompleted;

            versionCheckWorker.DoWork += CheckUpdates;
            versionCheckWorker.RunWorkerCompleted += OnUpdateCheckCompleted;

            binaryDownloader.DownloadProgressChanged += OnDownloadProgress;
            binaryDownloader.DownloadFileCompleted += OnDownloadCompleted;

            Shown += OnShown;
            FormClosed += OnFormClosed;

            // load and apply settings
            LoadLauncherSettings();

            switch( (StartingTab)cStartingTab.SelectedIndex ) {
                case StartingTab.Direct:
                    tabs.SelectedTab = tabDirect;
                    break;
                case StartingTab.Resume:
                    tabs.SelectedTab = tabResume;
                    break;
                case StartingTab.SignIn:
                    tabs.SelectedTab = tabSignIn;
                    break;
            }
        }