Esempio n. 1
0
        private void endButton_Click(object sender, EventArgs arg)
        {
            try
            {
                //フォルダが正しいか確認
                if (File.Exists(tvtestBox.Text) == false)
                {
                    throw new AppException("TVTestのパスが設定されていないか、間違っています。tvtest");
                }
                if (Directory.Exists(recDirBox.Text) == false)
                {
                    throw new AppException("録画フォルダのパスが設定されていないか、間違っています。record.folder");
                }

                //プラグインをコピーする
                try
                {
                    var plugin     = Path.Combine(Util.GetBasePath(), "TvmaidPlugin.tvtp");
                    var pluginDir  = Path.Combine(Path.GetDirectoryName(tvtestBox.Text), "Plugins");
                    var copyPlugin = Path.Combine(pluginDir, "TvmaidPlugin.tvtp");
                    File.Copy(plugin, copyPlugin, true);
                }
                catch (Exception e)
                {
                    throw new AppException("TVTestのプラグインフォルダに、Tvmaidプラグインをコピーできません。[詳細]" + e.Message);
                }

                //設定ファイルに入力
                tvmaidDef["tvtest"]        = tvtestBox.Text;
                tvmaidDef["record.folder"] = recDirBox.Text;
                tvmaidDef.Save();

                tunerDef.Clear();
                foreach (var item in tunerListBox.Items)
                {
                    var data = ((string)item).Split(new char[] { '=' });
                    tunerDef[data[0]] = data[1];
                }
                tunerDef.Save();

                //チューナ更新モードで起動
                System.Diagnostics.Process.Start(Path.Combine(Util.GetBasePath(), "Tvmaid.exe"), "-tunerupdate");

                this.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, logo);
            }
        }
Esempio n. 2
0
        private void MaidMon_FormClosing(object sender, FormClosingEventArgs e)
        {
            var def = stateDef;

            def["maidmon.window.left"]          = this.Left.ToString();
            def["maidmon.window.top"]           = this.Top.ToString();
            def["maidmon.window.width"]         = this.Width.ToString();
            def["maidmon.window.height"]        = this.Height.ToString();
            def["maidmon.window.title.width"]   = this.titleHeader.Width.ToString();
            def["maidmon.window.service.width"] = this.serviceHeader.Width.ToString();
            def["maidmon.window.time.width"]    = this.timeHeader.Width.ToString();
            def["maidmon.window.status.width"]  = this.statusHeader.Width.ToString();
            def["maidmon.window.host.width"]    = this.hostHeader.Width.ToString();
            def["maidmon.window.tuner.width"]   = this.tunerHeader.Width.ToString();
            stateDef.Save();
        }