Example #1
0
        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            ScenInfo         si  = _SceneCollection.Where(s => s.Description == listBox1.Text).FirstOrDefault();
            STemplateDetails obj = objWaspFileHandler.GetTemplatePlayerInfo(si.Id, "");

            if (obj != null)
            {
                Form obj1 = Activator.CreateInstance(obj.TemplatePlayerInfo) as Form;
                obj1.TopLevel = false;
                obj1.Visible  = true;
                var ctl = tableLayoutPanel1.GetControlFromPosition(1, RowPos);
                if (ctl != null) // Already control present there
                {
                    //First play out the graphic.
                    //then delete the gfx
                    tableLayoutPanel1.Controls.Remove(ctl);
                }
                tableLayoutPanel1.Controls.Add(obj1, 1, RowPos);
                if (RowPos == 1)
                {
                    RowPos--;
                }
                else
                {
                    RowPos++;
                }
                obj1.Show();
            }
            else
            {
                MessageBox.Show("Template " + si.Id + "Not found");
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        private void LoadTemplate()
        {
            try
            {
                string           templateid = ConfigurationManager.AppSettings["scorebugid"];
                STemplateDetails obj        = FileHandler.GetTemplatePlayerInfo(templateid, "");
                if (obj != null)
                {
                    objScorePlayer = Activator.CreateInstance(obj.TemplatePlayerInfo) as IPlayer;
                    if (objScorePlayer != null)
                    {
                        objScorePlayer.Init("", "", templateid, "");
                        objScorePlayer.SetLink(AppLink, obj.Scene);
                        if (objScorePlayer is IAddinInfo)
                        {
                            (objScorePlayer as IAddinInfo).Init(new InstanceInfo()
                            {
                                InstanceId = templateid
                            });
                        }

                        IChannelShotBox objChannelShotBox = objScorePlayer as IChannelShotBox;
                        if (objChannelShotBox != null)
                        {
                            objChannelShotBox.SetEngineUrl(m_serverip);
                        }

                        objScorePlayer.OnShotBoxControllerStatus += _objPlayer1_OnShotBoxControllerStatus;
                        objScorePlayer.OnShotBoxStatus           += _objPlayer1_OnShotBoxStatus;
                        objScorePlayer.Prepare(m_serverip, Convert.ToInt32(objScorePlayer.ZORDER), string.Empty, RENDERMODE.PROGRAM);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }