public OptionSummary(OptionsContent parent) { Parent = parent; if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots) SpotType = SpotType.Week; else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots) SpotType = SpotType.Month; else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) SpotType = SpotType.Total; else SpotType = SpotType.Week; ApplySettingsForAll = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.UniversalToggles; ; ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLogo; ShowCampaign = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowCampaign; ShowComments = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowComments; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTotalCost; ShowTallySpots = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallySpots; ShowTallyCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallyCost; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.UseDecimalRates; #endregion UpdateSpotType(true); }
public OptionSummary(OptionsContent parent) { Parent = parent; if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots) { SpotType = SpotType.Week; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots) { SpotType = SpotType.Month; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { SpotType = SpotType.Total; } else { SpotType = SpotType.Week; } ApplySettingsForAll = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.UniversalToggles;; ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowLogo; ShowCampaign = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowCampaign; ShowComments = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowComments; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTotalCost; ShowTallySpots = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallySpots; ShowTallyCost = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowTallyCost; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultOptionsSummarySettings.UseDecimalRates; #endregion UpdateSpotType(true); }
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 OptionSet(OptionsContent parent) { Parent = parent; UniqueID = Guid.NewGuid(); Index = parent.Options.Any() ? parent.Options.Max(s => s.Index) + 1 : 0; Logo = MediaMetaData.Instance.ListManager.Images.Where(g => g.IsDefault).Select(g => g.Images.FirstOrDefault(i => i.IsDefault)).FirstOrDefault()?.Clone <ImageSource, ImageSource>(); TotalPeriods = 1; Programs = new List <OptionProgram>(); DigitalInfo = new MediaDigitalInfo(); ContractSettings = new ContractSettings(); #region Options ShowLineId = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLineId; ShowLogo = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLogo; ShowStation = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowStation; ShowProgram = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowProgram; ShowDay = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowDay; ShowTime = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTime; ShowSpots = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots; ShowRate = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowRate; ShowLenght = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLenght; ShowCost = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowCost; ShowTotalSpots = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTallySpots; ShowTotalCost = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTallyCost; ShowAverageRate = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowAverageRate; ShowSpotsX = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowSpotsX; UseDecimalRates = MediaMetaData.Instance.ListManager.DefaultOptionsSettings.UseDecimalRates; DefaultColumnPositions = true; if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowStation) { PositionStation = DefaultPositionStation; } else { PositionStation = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowProgram) { PositionProgram = DefaultPositionProgram; } else { PositionProgram = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowDay) { PositionDay = DefaultPositionDay; } else { PositionDay = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTime) { PositionTime = DefaultPositionTime; } else { PositionTime = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowLenght) { PositionLenght = DefaultPositionLenght; } else { PositionLenght = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots || MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { PositionSpots = DefaultPositionSpots; } else { PositionSpots = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowRate) { PositionRate = DefaultPositionRate; } else { PositionRate = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowCost) { PositionCost = DefaultPositionCost; } else { PositionCost = -1; } if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowWeeklySpots) { SpotType = SpotType.Week; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowMonthlySpots) { SpotType = SpotType.Month; } else if (MediaMetaData.Instance.ListManager.DefaultOptionsSettings.ShowTotalSpots) { SpotType = SpotType.Total; } else { SpotType = SpotType.Week; } #endregion }
public void LoadContent(OptionsContent editedContent) { _editedContent = editedContent; _settingsControls.OfType<IContentSettingsControl>().ToList().ForEach(c => c.LoadContentData(_editedContent)); }