/// <summary> /// Sets the option values from a configuration object /// </summary> /// <param name="configuration"></param> /// <exception cref="System.ArgumentException">Thrown when the configuration doesn't match the expected type</exception> public override void SetValues(Configurations.ItemConfiguration configuration) { if (!(configuration is MarkeeConfiguration)) { throw new ArgumentException(string.Format("Given parameter was of type {0}. {1} expected", configuration.GetType().ToString(), typeof(ItemConfiguration).ToString()), "config"); } MarkeeConfiguration config = configuration as MarkeeConfiguration; ToolTip up = new ToolTip(); ToolTip down = new ToolTip(); ToolTip remove = new ToolTip(); up.SetToolTip(buttonMoveItemsUp, "Mover os items seleccionados para cima"); down.SetToolTip(buttonMoveItemsDown, "Mover os items seleccionados para baixo"); remove.SetToolTip(buttonRemoveItems, "Remover os items seleccionados"); footer = new Markee(ComponentTargetSite.OptionsMenu); //{ // TextList = config.Text, // Speed = config.Speed, // BackColor = config.BackColor, // TextColor = config.TextColor, // FooterFont = config.Font, // Direction = config.Direction, // Dock = DockStyle.Fill, // TransparentBackground = config.TransparentBackground //}; listBoxTextList.Items.Clear(); if (footer.TextList != null) { foreach (var item in footer.TextList) { listBoxTextList.Items.Add(item); } } foreach (var item in groupBoxPreview.Controls) { if (item is Markee) { groupBoxPreview.Controls.Remove(item as Markee); } } groupBoxPreview.Controls.Add(footer); trackBarSpeed.Value = footer.Speed; footer.Run(); }
public MarkeeComposer(MarkeeConfiguration config) { base.BackColor = Color.Green; base.Configuration = config; base.optionsForm = new MarkeeOptions() { MarkeeTextList = (Configuration as MarkeeConfiguration).Text, MarkeeDirection = (Configuration as MarkeeConfiguration).Direction, MarkeeSpeed = (Configuration as MarkeeConfiguration).Speed, MarkeeFont = (Configuration as MarkeeConfiguration).Font, MarkeeBackColor = (Configuration as MarkeeConfiguration).BackColor, MarkeeTextColor = (Configuration as MarkeeConfiguration).TextColor }; }
public MarkeeOptions(MarkeeConfiguration config) { InitializeComponent(); ToolTip up = new ToolTip(); ToolTip down = new ToolTip(); ToolTip remove = new ToolTip(); up.SetToolTip(buttonMoveItemsUp, "Mover os items seleccionados para cima"); down.SetToolTip(buttonMoveItemsDown, "Mover os items seleccionados para baixo"); remove.SetToolTip(buttonRemoveItems, "Remover os items seleccionados"); markee = new Markee(ComponentTargetSite.OptionsMenu); groupBoxPreview.Controls.Add(markee); markee.Dock = DockStyle.Fill; markee = new Markee(ComponentTargetSite.OptionsMenu) { TextList = config.Text, Speed = config.Speed, BackColor = config.BackColor, TextColor = config.TextColor, MarkeeFont = config.Font, Direction = config.Direction }; foreach (var item in markee.TextList) { listBoxTextList.Items.Add(item); } groupBoxPreview.Controls.Add(markee); markee.Dock = DockStyle.Fill; trackBarSpeed.Value = markee.Speed; markee.Run(); }
public void AddItemFromConfiguration(ItemConfiguration config) { try { if (config is DateTimeComposer)//MUDAR QUANDO FIZER O CONFIG CERTO { } else if (config is MarkeeConfiguration) { MarkeeConfiguration temp = config as MarkeeConfiguration; float newFontSize = this.ScaledFontSize(temp.Resolution.Height, temp.FinalResolution.Height, temp.Font.Size); Font scaledFont = new Font(temp.Font.Name, newFontSize, temp.Font.Style, temp.Font.Unit, temp.Font.GdiCharSet, temp.Font.GdiVerticalFont); Markee markee = new Markee(ComponentTargetSite.Player) { Location = temp.FinalLocation, Size = temp.FinalSize, TextList = temp.Text, Speed = temp.Speed, MarkeeFont = scaledFont, BackColor = temp.BackColor, TextColor = temp.TextColor, ContextMenuStrip = contextMSFooter }; this.Controls.Add(markee); markee.Run(); } else if (config is ImageComposer)//MUDAR { } else if (config is PriceListComposer)//MUDAR { } else if (config is SlideShowComposer)//MUDAR { } else if (config is TVConfiguration) { var temp = config as TVConfiguration; #region using DigitalTVScreen /* * DigitalTVScreen tvDisplay = new DigitalTVScreen() { Location = temp.FinalLocation, Size = temp.FinalSize }; * tvDisplay.ChannelListChanged += tvDisplay_ChannelListChanged; * tvDisplay.Frequencia = 754000; * tvDisplay.Start(); * tvDisplay.Tune(); * * tvDisplay.ContextMenuStrip = contextMSTV; * * this.Controls.Add(tvDisplay); */ #endregion DigitalTVScreen tvScreen = new DigitalTVScreen() { Location = temp.FinalLocation, Size = temp.FinalSize }; tvScreen.Channels.Frequency = temp.Frequency; tvScreen.Channels.ForceRebuildOnChannelTune = true; DirectShowLib.DsDevice dev; if (DigitalTVScreen.DeviceStuff.TunerDevices.TryGetValue(temp.TunerDevicePath, out dev)) { tvScreen.Devices.TunerDevice = dev; } tvScreen.ContextMenuStrip = contextMSTV; this.Controls.Add(tvScreen); try { tvScreen.Channels.LoadFromXML(); } catch (Exception) { tvScreen.Channels.RefreshChannels(); //Só funciona em Portugal. Compor o ecra de opçoes no composer tvScreen.Channels.SaveToXML(); } foreach (var ch in tvScreen.Channels.ChannelList) { (contextMSTV.Items["canalTVTSMItem"] as ToolStripMenuItem).DropDownItems.Add(ch.Name, null, (object sender, EventArgs e) => { tvScreen.Channels.TuneChannel(ch); }); } if (tvScreen.Channels.ChannelList.Count > 0) { tvScreen.Channels.TuneChannel(tvScreen.Channels.ChannelList[0]); } //tvScreen.Start(); } else if (config is VideoComposer)//MUDAR { } else if (config is WaitListComposer)//MUDAR { } else if (config is WeatherComposer)//MUDAR { } } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif } }
public FooterOptionsView(MarkeeConfiguration config) : base(config) { InitializeComponent(); }