示例#1
0
文件: ppt.cs 项目: solunar66/AdPlayer
 public OperatePPT()
 {
     hook = new Hook();
 }
示例#2
0
        public Form_Play()
        {
            InitializeComponent();

            this.Text = "宣传播放系统";
            this.axFramerControl1.Location = new Point(-500, -500);
            this.rootPath = Directory.GetCurrentDirectory();
            xml = new XMLInfo(rootPath + "\\config\\play.xml");

            string pwd, pmt; bool ebl;
            FTP.ApplicationSettings._DataPath = rootPath;
            FTP.ApplicationSettings.ReadSettings();
            FTP.ApplicationSettings.GetUser("ADPLAYER", out pwd, out interMediaPath, out pmt, out ebl);

            // 读取配置
            if (!xml.ReadPlayConfig(ref config, ref error))
            {
                MessageBox.Show("没有检测到正确的配置文件!\n\n请将检查配置文件\"config\\play.xml\"\n\n错误信息: " + error, "启动异常", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                this.Close();
            }
            else
            {
                numericUpDown2.Value = config.notice.interval;

                // 播放器设置
                axWindowsMediaPlayer1.uiMode = "none";
                axWindowsMediaPlayer1.stretchToFit = true;
                axWindowsMediaPlayer1.Ctlenabled = true;
                axWindowsMediaPlayer1.settings.setMode("loop", false);// 循环

                Screen[] scr = Screen.AllScreens;
                if (scr.Length > 1)
                {
                    label8.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
                    comboBox_scr.Enabled = true;
                    for (int i = 0; i < scr.Length; i++)
                    {
                        comboBox_scr.Items.Add(scr[i].DeviceName);
                    }
                    if (config.scr < scr.Length) comboBox_scr.SelectedIndex = config.scr;
                }

                comboBox_idle.Items.Add(ContentType.video);
                comboBox_idle.Items.Add(ContentType.powerpoint);
                comboBox_idle.SelectedIndex = (int)(config.idle.type) - 1;
                numericUpDown_idle.Value = (decimal)config.idle.duration;
                label_idle.Text = config.idle.file;

                dateTimePicker_sleepStart.Value = config.sleep.timespan.startTime;
                dateTimePicker_sleepEnd.Value = config.sleep.timespan.endTime;
                checkBox_sleep.Checked = config.sleep.enable;
                checkBox_sleep_CheckedChanged(this, null);

                checkBox_interval.Checked = config.intermedia.enable;
                checkBox_interval_CheckedChanged(this, null);
                numericUpDown_interval.Value = config.intermedia.limit;
                numericUpDown_duration.Value = config.intermedia.duration;

                checkBox1.Checked = config.syscfg.sysDuration;
                numericUpDown1.Value = config.syscfg.duration;

                hook = new Hook();
            }

            bgWorker_RunTask = new BackgroundWorker();
            bgWorker_RunTask.WorkerReportsProgress = false;
            bgWorker_RunTask.DoWork += new DoWorkEventHandler(bgWorker_RunTask_DoWork);
            bgWorker_RunTask.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWorker_RunTask_RunWorkerCompleted);
            bgWorker_RunTask.RunWorkerAsync();

            Form_Start start = new Form_Start();
            start.ShowDialog();
        }