/// <summary>
        /// Applies the configuration options to the component
        /// </summary>
        /// <param name="component"></param>
        /// <exception cref="System.ArgumentException">Thrown when the player object doesn't match the expected type</exception>
        public override void ApplyChangesToComponent(Assemblies.Components.ComposerComponent component)
        {
            if (!(component is Markee))
            {
                throw new ArgumentException(string.Format("Given parameter was of type {0}. {1} expected", component.GetType().ToString(), typeof(Markee).ToString()), "config");
            }


            Markee comp = component as Markee;

            try
            {
                comp.TextList   = footer.TextList;
                comp.Speed      = footer.Speed;
                comp.BackColor  = footer.BackColor;
                comp.TextColor  = footer.TextColor;
                comp.MarkeeFont = footer.MarkeeFont;
                comp.Direction  = footer.Direction;
            }
            catch (Exception ex)
            {
#if DEBUG
                MessageBox.Show("ApplyChangesToComponent" + Environment.NewLine + ex.Message);
#endif
            }
        }
        public MarkeeOptions(Markee temp)
        {
            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)
            {
                TextList = temp.TextList, Speed = temp.Speed, BackColor = temp.BackColor, TextColor = temp.TextColor, MarkeeFont = temp.MarkeeFont, Direction = markee.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();
        }
        /// <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 MarkeeOptions()
        {
            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;
        }
        public FooterOptionsView() : base()
        {
            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");

            footer = new Markee(ComponentTargetSite.OptionsMenu);

            groupBoxPreview.Controls.Add(footer);
            footer.Dock = DockStyle.Fill;
            FooterTransparentBackground = false;
        }
        /// <summary>
        /// Sets the option values from a player object
        /// </summary>
        /// <param name="configuration"></param>
        /// <exception cref="System.ArgumentException">Thrown when the player object doesn't match the expected type</exception>
        public override void SetValues(Components.ComposerComponent component)
        {
            if (!(component is Markee))
            {
                throw new ArgumentException(string.Format("Given parameter was of type {0}. {1} expected", component.GetType().ToString(), typeof(Markee).ToString()), "config");
            }

            Markee temp = component as Markee;

            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 = temp.TextList, Speed = temp.Speed, BackColor = temp.BackColor, TextColor = temp.TextColor, MarkeeFont = temp.MarkeeFont, Direction = footer.Direction
            };

            listBoxTextList.Items.Clear();
            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);

            footer.Dock = DockStyle.Fill;

            trackBarSpeed.Value = footer.Speed;

            footer.Run();
        }
        public void ApplyChangesToComponent(Assemblies.Components.ComposerComponent component)
        {
            Markee comp = component as Markee;

            try
            {
                comp.TextList   = markee.TextList;
                comp.Speed      = markee.Speed;
                comp.BackColor  = markee.BackColor;
                comp.TextColor  = markee.TextColor;
                comp.MarkeeFont = markee.MarkeeFont;
                comp.Direction  = markee.Direction;
            }
            catch (Exception ex)
            {
#if DEBUG
                MessageBox.Show("ApplyChangesToComponent" + Environment.NewLine + ex.Message);
#endif
            }
        }
        public ComposerComponent FromConfiguration(Configurations.ItemConfiguration config)
        {
            if (!(config is Assemblies.Configurations.MarkeeConfiguration))
            {
                return(null);
            }

            Markee m = new Markee(ComponentTargetSite.Builder);

            Assemblies.Configurations.MarkeeConfiguration mConfig = config as Assemblies.Configurations.MarkeeConfiguration;

            m.Configuration = mConfig;

            m.TextList   = mConfig.Text;
            m.MarkeeFont = mConfig.Font;
            m.Speed      = mConfig.Speed;
            m.Direction  = mConfig.Direction;
            m.BackColor  = mConfig.BackColor;
            m.TextColor  = mConfig.TextColor;

            return(m);
        }
        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(Markee temp) : base(temp)
 {
     InitializeComponent();
 }