Example #1
0
        private void btnEditTemplate_Click(object sender, EventArgs e)
        {
            try
            {
                var templateName = "HDTemplates\\" + getTemplateName(_tempName);
                var frmInput     = new PreviewForm(templateName);

                frmInput.LoadTemplateHost(Path.Combine(AppSetting.Default.TemplateFolder, "cg20.fth.1080i5000"));

                UpdateTemplate(frmInput, _tempName);
            }
            catch (Exception ex)
            {
                HDMessageBox.Show("404 NOT FOUND: " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
        public string UpdateTemplate(PreviewForm frmInput, string templateFileName, int fadeUpDuration = 0)
        {
            string templateFile = "HDTemplates\\" + templateFileName;
            var    lstData      = Utils.GetObject <List <Object.tempUpdating> >(_updateDataXml);

            dicTemplateData.Clear();
            foreach (var data in lstData)
            {
                dicTemplateData.Add(data.Name, data.Data);
            }
            try
            {
                int nTry = 0;

TryHere:

                if (frmInput.player.Add(1, templateFile))
                {
                    if (dicTemplateData.ContainsKey("HDTemplates\\" + templateFileName))
                    {
                        frmInput.player.Update(1, dicTemplateData["HDTemplates\\" + templateFileName].Replace("\\n", "\n"));
                    }
                    frmInput.player.Refresh();
                    frmInput.player.InvokeMethod(1, "fadeUp");

                    frmInput.Show();
                    frmInput.Activate();
                }
                else
                {
                    nTry++;
                    if (nTry < 1)
                    {
                        frmInput.Clear();
                        goto TryHere;
                    }
                    throw new Exception("Can not cue graphics!");
                }
            }
            catch
            {
                HDMessageBox.Show("Can't edit this template!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(templateFile);
        }