public void LoadData() { if (!_needToReload) return; _allowToSave = false; _summaryControls.ForEach(s => s.Release()); _summaryControls.Clear(); xtraScrollableControl.Controls.Clear(); _summaryControls.AddRange(_container.EditedContent.DigitalProducts.Select(product => { var summaryControl = new DigitalProductSummaryControl(); summaryControl.LoadData(product); return summaryControl; })); if (_summaryControls.Any()) { xtraScrollableControl.Controls.AddRange(_summaryControls.OfType<Control>().Reverse().ToArray()); xtraScrollableControl.ScrollControlIntoView(_summaryControls[0]); SetFocus(); } checkEditStatement.Checked = !String.IsNullOrEmpty(_container.EditedContent.DigitalProductSummary.Statement); memoEditStatement.EditValue = _container.EditedContent.DigitalProductSummary.Statement; checkEditMonthlyInvestment.Checked = _container.EditedContent.DigitalProductSummary.MonthlyInvestment.HasValue; spinEditMonthlyInvestment.EditValue = _container.EditedContent.DigitalProductSummary.MonthlyInvestment; checkEditTotalInvestment.Checked = _container.EditedContent.DigitalProductSummary.TotalInvestment.HasValue; spinEditTotalInvestment.EditValue = _container.EditedContent.DigitalProductSummary.TotalInvestment; _allowToSave = true; _needToReload = false; }
public DigitalProductControl(IDigitalProductsContainer container) { InitializeComponent(); _container = container; Dock = DockStyle.Fill; if ((base.CreateGraphics()).DpiX > 96) { var font = new Font(styleController.Appearance.Font.FontFamily, styleController.Appearance.Font.Size - 2, styleController.Appearance.Font.Style); styleController.Appearance.Font = font; styleController.AppearanceDisabled.Font = font; styleController.AppearanceDropDown.Font = font; styleController.AppearanceDropDownHeader.Font = font; styleController.AppearanceFocused.Font = font; styleController.AppearanceReadOnly.Font = font; font = new Font(labelControlWebsite.Font.FontFamily, labelControlWebsite.Font.Size - 3, labelControlWebsite.Font.Style); labelControlWebsite.Font = font; labelControlProduct.Font = font; labelControlDescription.Font = font; labelControlPriceType.Font = font; labelControlComments.Font = font; checkEditFormulaCPM.Font = new Font(checkEditFormulaCPM.Font.FontFamily, checkEditFormulaCPM.Font.Size - 2, checkEditFormulaCPM.Font.Style); checkEditFormulaImpressions.Font = new Font(checkEditFormulaImpressions.Font.FontFamily, checkEditFormulaImpressions.Font.Size - 2, checkEditFormulaImpressions.Font.Style); checkEditFormulaInvestment.Font = new Font(checkEditFormulaInvestment.Font.FontFamily, checkEditFormulaInvestment.Font.Size - 2, checkEditFormulaInvestment.Font.Style); hyperLinkEditResetProductName.Font = new Font(hyperLinkEditResetProductName.Font.FontFamily, hyperLinkEditResetProductName.Font.Size - 2, hyperLinkEditResetProductName.Font.Style); hyperLinkEditReset.Font = new Font(hyperLinkEditReset.Font.FontFamily, hyperLinkEditReset.Font.Size - 2, hyperLinkEditReset.Font.Style); } labelControlWebsite.Appearance.Image = ListManager.Instance.DefaultControlsConfiguration.ProductEditorsSitesLogo; labelControlWebsite.Text = String.Format("<color=#838383>{0}</color>", ListManager.Instance.DefaultControlsConfiguration.ProductEditorsSitesTitle ?? labelControlWebsite.Text); labelControlProduct.Appearance.Image = ListManager.Instance.DefaultControlsConfiguration.ProductEditorsNameLogo; labelControlProduct.Text = String.Format("<color=#838383>{0}</color>", ListManager.Instance.DefaultControlsConfiguration.ProductEditorsNameTitle ?? labelControlProduct.Text); labelControlDescription.Appearance.Image = ListManager.Instance.DefaultControlsConfiguration.ProductEditorsDescriptionLogo; labelControlDescription.Text = String.Format("<color=#838383>{0}</color>", ListManager.Instance.DefaultControlsConfiguration.ProductEditorsDescriptionTitle ?? labelControlDescription.Text); labelControlPriceType.Appearance.Image = ListManager.Instance.DefaultControlsConfiguration.ProductEditorsPricingLogo; labelControlPriceType.Text = String.Format("<color=#838383>{0}</color>", ListManager.Instance.DefaultControlsConfiguration.ProductEditorsPricingTitle ?? labelControlPriceType.Text); labelControlComments.Appearance.Image = ListManager.Instance.DefaultControlsConfiguration.ProductEditorsCommentsLogo; labelControlComments.Text = String.Format("<color=#838383>{0}</color>", ListManager.Instance.DefaultControlsConfiguration.ProductEditorsCommentsTitle ?? labelControlComments.Text); spinEditImpressions.EnableSelectAll(); spinEditImpressionsOnly.EnableSelectAll(); spinEditInvestment.EnableSelectAll(); spinEditInvestmentOnly.EnableSelectAll(); spinEditCPM.EnableSelectAll(); comboBoxEditStrengths1.DisableSelectAll(); comboBoxEditStrengths2.DisableSelectAll(); spinEditImpressions.EditValue = null; spinEditInvestment.EditValue = null; AssignCloseActiveEditorsonOutSideClick(this); SummaryControl = new DigitalProductSummaryControl(); }
public void Release() { SummaryControl.Release(); SummaryControl = null; Product = null; }