当前位置: 首页>>代码示例>>C#>>正文


C# IPlayer.Init方法代码示例

本文整理汇总了C#中IPlayer.Init方法的典型用法代码示例。如果您正苦于以下问题:C# IPlayer.Init方法的具体用法?C# IPlayer.Init怎么用?C# IPlayer.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPlayer的用法示例。


在下文中一共展示了IPlayer.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadBackground

        /// <summary>
        /// Load background template
        /// </summary>
        /// <param name="templateid"></param>
        public void LoadBackground(TemplateInfo tempinfo, string id)
        {
            try
            {
                objBGPlayer = Activator.CreateInstance(tempinfo.TemplatePlayerInfo) as IPlayer;
                if (objBGPlayer != null)
                {
                    objBGPlayer.Init("", "", id, "");
                    objBGPlayer.SetLink(AppLink, tempinfo.MetaDataXml);
                    if (objBGPlayer is IAddinInfo)
                        (objBGPlayer as IAddinInfo).Init(new InstanceInfo() { InstanceId = id });

                    IChannelShotBox objChannelShotBox = objBGPlayer as IChannelShotBox;
                    if (objChannelShotBox != null)
                    {
                        objChannelShotBox.SetEngineUrl(m_serverurl);
                    }
                    objBGPlayer.OnShotBoxStatus += objPlayer1_OnShotBoxStatus;
                    objBGPlayer.OnShotBoxControllerStatus += objPlayer1_OnShotBoxStatus;
                    objBGPlayer.Prepare(m_serverurl, 0, string.Empty, RENDERMODE.PROGRAM);
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteLog(ex);
            }
        }
开发者ID:WASP3D,项目名称:Soccer-App,代码行数:31,代码来源:SceneHandler.cs

示例2: GetTemplate

        /// <summary>
        /// Method to get template details and player
        /// </summary>
        /// <param name="str"></param>
        /// <param name="column"></param>
        private void GetTemplate(string str, string column)
        {
            try
            {
                string columnname = column;
                ScenInfo si = m_lstSceneCollection.Where(s => s.Description == str).FirstOrDefault();
                TemplateInfo obj = objPlayergetter.GetPlayerInfo(si.Id);
                m_objPlayer = Activator.CreateInstance(obj.TemplatePlayerInfo) as IPlayer;
                Form objfrm = m_objPlayer as Form;
                SetMatchUdt(objfrm);
                if (m_objPlayer != null)
                {
                    m_objPlayer.Init("", "", si.Id, "");
                    m_objPlayer.SetLink(m_objsceneHandler.AppLink, obj.MetaDataXml);
                    //S. No 116: Added for AddIn
                    //S.No.	: -	128
                    if (m_objPlayer is IAddinInfo)
                        (m_objPlayer as IAddinInfo).Init(new InstanceInfo() { InstanceId = si.Id });

                    IDataEntry objDataentry = m_objPlayer as IDataEntry;
                    if (objDataentry != null)
                    {
                        objDataentry.PostData += objDataentry_PostData;
                    }

                    IChannelShotBox objChannelShotBox = m_objPlayer as IChannelShotBox;
                    if (objChannelShotBox != null)
                    {
                        objChannelShotBox.SetEngineUrl(m_serverurl);
                    }

                    m_objPlayer.OnShotBoxControllerStatus += objPlayer_OnShotBoxControllerStatus;
                    m_objPlayer.Prepare(m_serverurl, Convert.ToInt32(m_objPlayer.ZORDER), string.Empty, RENDERMODE.PROGRAM);
                }
                if (columnname != "-1")
                {
                    objfrm.TopLevel = false;
                    objfrm.Visible = false;
                    objfrm.Dock = DockStyle.Fill;
                    Control ctl = null;
                    Control ctl2 = null;
                    if (string.Compare(columnname, "Column2", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        ctl = tableLayoutPanel1.GetControlFromPosition(0, 0);
                        if (ctl != null) // Already control present there
                        {
                            //First play out the graphic.
                            //then delete the gfx
                            tableLayoutPanel1.Controls.Remove(ctl);
                            (ctl as IPlayer).DeleteSg();
                            tableLayoutPanel1.Controls.Add(objfrm, 0, 0);
                        }
                    }

                    if (string.Compare(columnname, "Column3", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        ctl2 = tableLayoutPanel1.GetControlFromPosition(1, 0);
                        if (ctl2 != null) // Already control present there
                        {
                            //First play out the graphic.
                            //then delete the gfx
                            tableLayoutPanel1.Controls.Remove(ctl2);
                            (ctl2 as IPlayer).DeleteSg();
                            tableLayoutPanel1.Controls.Add(objfrm, 1, 0);
                        }
                    }
                    if (ctl == null && (string.Compare(columnname, "Column2",StringComparison.OrdinalIgnoreCase) == 0))
                    {
                        tableLayoutPanel1.Controls.Add(objfrm, 0, 0);
                    }
                    else if (ctl2 == null && (string.Compare(columnname, "Column3", StringComparison.OrdinalIgnoreCase) == 0))
                    {
                        tableLayoutPanel1.Controls.Add(objfrm, 1, 0);
                    }
                    objfrm.Show();
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteLog(ex);
            }
        }
开发者ID:WASP3D,项目名称:Soccer-App,代码行数:87,代码来源:SoccerApp.cs


注:本文中的IPlayer.Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。