コード例 #1
0
 private void TemplateDataSet_TemplateDataSetChanged(API.TemplateDataSetEventArgs e)
 {
     try
     {
         CheckExecuteOnGUIThread(() => CheckParameters());
     }
     catch (Exception ex) //Always catch exceptions in template calls. If not the template might restart in a new process.
     {
         m_Template.Debug(API.DebugLevel.High, API.DebugCategory.Error, "Failed to change dataset " + ex.Message);
     }
 }
コード例 #2
0
 private void TemplateDataSet_TemplateDataSetChanged(API.TemplateDataSetEventArgs e)
 {
     try
     {
         CheckExecuteOnGUIThread(() => CheckDataSetChange(e.TemplateDataSet));
     }
     catch (Exception ex) //Always catch exceptions in template calls. If not the template might restart in a new process.
     {
         m_Template.Debug(API.DebugLevel.High, API.DebugCategory.Error, "Failed to change dataset" + Environment.NewLine + ex.ToString());
         m_Template.MediaEnded();
     }
 }
コード例 #3
0
        private void TemplateDataSet_TemplateDataSetChanged2(object sender, API.TemplateDataSetEventArgs e)
        {
            string masterIP = e.TemplateDataSet.GetTemplateDataSetItemAsText("MasterIP");

            if (_WarpSpace == null)
            {
                //Assume only one template per player
                _WarpSpace = _Template.GetWarpSpace("MyWarpSpaceChannel", masterIP);
                _WarpSpace.PeerRegistered  += _WarpSpace_PeerRegistered;
                _WarpSpace.MessageReceived += _WarpSpace_MessageReceived;
            }
        }
コード例 #4
0
        //private void Template_PreviewRequested(object sender, API.PreviewRequestEventArgs e)
        //{
        //    try
        //    {
        //        GeneratePreview();
        //        e.PreviewRequestFinished = true;
        //    }
        //    catch (Exception ex) //Always catch exceptions in template calls. If not the template might restart in a new process.
        //    {
        //        m_Template.Debug(API.DebugLevel.High, API.DebugCategory.Error, "Failed to generate preview" + Environment.NewLine + ex.ToString());
        //        //No need to exit
        //    }
        //}

        private void TemplateDataSet_TemplateDataSetChanged(object sender, API.TemplateDataSetEventArgs e)
        {
            try
            {
                CheckDataSetChange(e.TemplateDataSet);

                //Make a call
                int files = m_Template.GetFiles().Count();
                m_Template.Debug(API.DebugLevel.High, API.DebugCategory.Information, "Player has " + files + " files available");
                Console.WriteLine("Player has " + files + " files available");
            }
            catch (Exception ex) //Always catch exceptions in template calls. If not the template might restart in a new process.
            {
                m_Template.Debug(API.DebugLevel.High, API.DebugCategory.Error, "Failed to change dataset" + Environment.NewLine + ex.ToString());
                m_Template.MediaEnded();
            }
        }