Ejemplo n.º 1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // Enables double-buffering to reduce flicker.
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);

            var state = Presenter.LoadCommon();

            Size              = state.WindowSize;
            Location          = state.Location;
            WindowState       = state.WindowState;
            txtSaveTo.Text    = state.SaveTo;
            cbTitleUrl.Text   = state.Url;
            cbSaveCbz.Checked = state.CbzChecked;

            dgvQueueChapter.AutoGenerateColumns = false;
            dgvChapter.AutoGenerateColumns      = false;

            Text = $@"{Application.ProductName} {Application.ProductVersion}";

            try
            {
                foreach (var service in pluginList)
                {
                    var infor = service.GetInformation();
                    dgvSupportedSites.Rows.Add(infor.Name, infor.Link, infor.Language);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, ex.Message);
            }

            if (string.IsNullOrWhiteSpace(txtSaveTo.Text))
            {
                txtSaveTo.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            }

            Presenter.LoadDownloadChapterTasks();
            LoadBookmark();
            CheckForUpdate();
        }