예제 #1
0
        public void LoadContentData(OptionsContent content)
        {
            _content = content;

            _allowToSave = false;

            buttonXLineId.Checked     = _content.OptionsSummary.ShowLineId;
            buttonXCampaign.Checked   = _content.OptionsSummary.ShowCampaign;
            buttonXComments.Checked   = _content.OptionsSummary.ShowComments;
            buttonXLogo.Checked       = _content.OptionsSummary.ShowLogo;
            buttonXTotalCost.Checked  = _content.OptionsSummary.ShowTotalCost;
            buttonXTallySpots.Checked = _content.OptionsSummary.ShowTallySpots;
            buttonXTallyCost.Checked  = _content.OptionsSummary.ShowTallyCost;

            switch (_content.OptionsSummary.SpotType)
            {
            case SpotType.Week:
                buttonXWeeklySpots.Enabled = true;
                buttonXWeeklyCost.Enabled  = true;
                buttonXTotalWeeks.Enabled  = true;
                buttonXWeeklySpots.Checked = _content.OptionsSummary.ShowSpots;
                buttonXWeeklyCost.Checked  = _content.OptionsSummary.ShowCost;
                buttonXTotalWeeks.Checked  = _content.OptionsSummary.ShowTotalPeriods;

                buttonXMonthlySpots.Enabled = false;
                buttonXMonthlyCost.Enabled  = false;
                buttonXTotalMonths.Enabled  = false;
                buttonXTotalSpots.Enabled   = false;

                buttonXMonthlySpots.Checked = false;
                buttonXMonthlyCost.Checked  = false;
                buttonXTotalMonths.Checked  = false;
                buttonXTotalSpots.Checked   = false;
                break;

            case SpotType.Month:
                buttonXMonthlySpots.Enabled = true;
                buttonXMonthlyCost.Enabled  = true;
                buttonXTotalMonths.Enabled  = true;
                buttonXMonthlySpots.Checked = _content.OptionsSummary.ShowSpots;
                buttonXMonthlyCost.Checked  = _content.OptionsSummary.ShowCost;
                buttonXTotalMonths.Checked  = _content.OptionsSummary.ShowTotalPeriods;

                buttonXWeeklySpots.Enabled = false;
                buttonXWeeklyCost.Enabled  = false;
                buttonXTotalWeeks.Enabled  = false;
                buttonXTotalSpots.Enabled  = false;

                buttonXWeeklySpots.Checked = false;
                buttonXWeeklyCost.Checked  = false;
                buttonXTotalWeeks.Checked  = false;
                buttonXTotalSpots.Checked  = false;
                break;

            case SpotType.Total:
                buttonXTotalSpots.Enabled = true;
                buttonXTotalSpots.Checked = _content.OptionsSummary.ShowSpots;

                buttonXWeeklySpots.Enabled  = false;
                buttonXWeeklyCost.Enabled   = false;
                buttonXTotalWeeks.Enabled   = false;
                buttonXMonthlySpots.Enabled = false;
                buttonXMonthlyCost.Enabled  = false;
                buttonXTotalMonths.Enabled  = false;

                buttonXWeeklySpots.Checked  = false;
                buttonXWeeklyCost.Checked   = false;
                buttonXTotalWeeks.Checked   = false;
                buttonXMonthlySpots.Checked = false;
                buttonXMonthlyCost.Checked  = false;
                buttonXTotalMonths.Checked  = false;
                break;
            }

            _allowToSave = true;
        }
 public void LoadContent(OptionsContent editedContent)
 {
     _editedContent = editedContent;
     _settingsControls.OfType <IContentSettingsControl>().ToList().ForEach(c => c.LoadContentData(_editedContent));
 }