Пример #1
0
        public void Show(PlayerWindowInformation information)
        {
            try
            {
                this.shapeSetByPlayerWndInfo = new Rectangle(information.Display.Bounds.Location.X, information.Display.Bounds.Location.Y, information.Display.Bounds.Size.Width, information.Display.Bounds.Size.Height);

                this.Location = new Point(information.Display.Bounds.Location.X, information.Display.Bounds.Location.Y);
                this.Size     = new Size(information.Display.Bounds.Size.Width, information.Display.Bounds.Size.Height);

                this.BackgroundImage       = information.Background;
                this.BackgroundImageLayout = information.BackgroundImageLayout;

                this.DisplayName = information.Display.DeviceID;

                foreach (ItemConfiguration config in information.Components)
                {
                    this.AddItemFromConfiguration(config);
                }

                this.TopMost = true;

                this.Show();
            }
            catch (Exception ex)
            {
#if DEBUG
                MessageBox.Show(ex.TargetSite + Environment.NewLine + ex.Message);
#endif
            }
        }
Пример #2
0
        //A partir daqui é tudo feito a partir do Player
        // TODO - Alterar os métodos para receberem o id do display em vez de chamar sempre o principal

        #region Janela do Player
        public override void OpenPlayerWindow(PlayerWindowInformation configurations)
        {
            try
            {
                player.OpenPlayer(NetWCFConverter.ToWCF(configurations));
            }
            catch
            {
            }
        }
Пример #3
0
        void Player_OpenPlayerWindow(PlayerWindowInformation config)
        {
            if (playerWindows.Keys.Contains(config.Display.DeviceID))
            {
                return;
            }

            FormJanelaFinal newWindow = new FormJanelaFinal(playerWindows, config.Display.DeviceID);

            newWindow.Show(config);

            playerWindows.Add(config.Display.DeviceID, newWindow);
        }
Пример #4
0
        private void buttonPlayer_Click(object sender, EventArgs e)
        {
            if (connection != null && !connection.PlayerWindowIsOpen())
            {
                #region PlayerWindowInformation
                PlayerWindowInformation info = new PlayerWindowInformation();

                List <ItemConfiguration> configs = new List <ItemConfiguration>();
                try
                {
                    foreach (var composerComponent in panelBuilder.Controls.OfType <ComposerComponent>())
                    {
                        configs.Add(composerComponent.Configuration);
                    }

                    info.Components            = configs;
                    info.Display               = Connection.GetDisplayInformation().Single(x => x.Primary);
                    info.Background            = panelBuilder.BackgroundImage;
                    info.BackgroundImageLayout = panelBuilder.BackgroundImageLayout;

                    /*
                     * 1 - Transformar o info.Display num IEnumerable de displays
                     * 2 - Fazer com que sejam abertas várias janelas nos displays inseridos
                     */

                    Connection.Open();
                    Connection.OpenPlayerWindow(info);
                }
                catch
                {
                }
                #endregion

                #region PlayerWindowInformation2
                //PlayerWindowInformation2 info = new PlayerWindowInformation2();

                //List<ItemConfiguration> configs = new List<ItemConfiguration>();

                //Connection.Open();

                //foreach (var composerComponent in panelBuilder.Controls.Cast<ComposerComponent>())
                //{
                //    configs.Add(composerComponent.Configuration);
                //}

                //info.Configuration
                #endregion

                UpdatePlayerStatus();
            }
        }
Пример #5
0
        public static WCFPlayerWindowInformation ToWCF(PlayerWindowInformation info)
        {
            MemoryStream mem = new MemoryStream();

            if (info.Background != null)
            {
                info.Background.Save(mem, info.Background.RawFormat);
            }

            return(new WCFPlayerWindowInformation()
            {
                Components = ToWCF(info.Components).ToArray(), Display = ToWCF(info.Display), Background = mem.ToArray(), BackgroundImageLayout = Convert.ToInt32(info.BackgroundImageLayout)
            });
        }
Пример #6
0
 void Player_EditPlayerWindow(PlayerWindowInformation config)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public abstract void OpenPlayerWindow(PlayerWindowInformation configurations);