From e594739cb7a947a8cb58e4fb4e62597c2926d237 Mon Sep 17 00:00:00 2001 From: Anime4000 Date: Thu, 8 Oct 2015 18:49:42 +0800 Subject: [PATCH] better settings --- hfrgen/Properties/AssemblyInfo.cs | 2 +- hfrgen/Properties/Resources.Designer.cs | 20 ++-- hfrgen/Properties/Resources.resx | 12 ++- hfrgen/Properties/Settings.Designer.cs | 46 ++++++++- hfrgen/Properties/Settings.settings | 11 ++- hfrgen/app.config | 11 ++- hfrgen/frmMain.cs | 87 ++++++++++++----- hfrgen/frmMain.designer.cs | 1 + hfrgen/frmSetting.Designer.cs | 122 ++++++++++++++++++++++-- hfrgen/frmSetting.cs | 71 ++++++++++---- 10 files changed, 313 insertions(+), 70 deletions(-) diff --git a/hfrgen/Properties/AssemblyInfo.cs b/hfrgen/Properties/AssemblyInfo.cs index db8ece6..b8645e9 100644 --- a/hfrgen/Properties/AssemblyInfo.cs +++ b/hfrgen/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.*")] -[assembly: AssemblyFileVersion("0.0.1.0")] +[assembly: AssemblyFileVersion("0.0.2")] diff --git a/hfrgen/Properties/Resources.Designer.cs b/hfrgen/Properties/Resources.Designer.cs index d10df5b..5f0ad34 100644 --- a/hfrgen/Properties/Resources.Designer.cs +++ b/hfrgen/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -81,13 +81,10 @@ internal static System.Drawing.Icon lightning_go { } /// - /// Looks up a localized string similar to Cores={0} + /// Looks up a localized string similar to {0} + ///Cores={1} ///SetMemoryMax(512) ///SetMTMode(3, Cores) - ///PluginPath = "{1}\" - ///LoadPlugin(PluginPath+"svpflow1.dll") - ///LoadPlugin(PluginPath+"svpflow2.dll") - ///Import(PluginPath+"InterFrame2.avsi") ///DirectShowSource("{2}").ConvertToYV12() ///SetMTMode(2) ///InterFrame(Cores=Cores, Preset="{3}", Tuning="{4}", FrameDouble={5}, GPU={6}, InputType="{7}"{8}). @@ -97,5 +94,16 @@ internal static string ScriptHFR { return ResourceManager.GetString("ScriptHFR", resourceCulture); } } + + /// + /// Looks up a localized string similar to LoadPlugin("{0}") + ///LoadPlugin("{1}") + ///Import("{2}"). + /// + internal static string ScriptPlugin { + get { + return ResourceManager.GetString("ScriptPlugin", resourceCulture); + } + } } } diff --git a/hfrgen/Properties/Resources.resx b/hfrgen/Properties/Resources.resx index b3c0ae2..a40ba7a 100644 --- a/hfrgen/Properties/Resources.resx +++ b/hfrgen/Properties/Resources.resx @@ -125,15 +125,17 @@ ..\Resources\lightning_go.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - Cores={0} + {0} +Cores={1} SetMemoryMax(512) SetMTMode(3, Cores) -PluginPath = "{1}\" -LoadPlugin(PluginPath+"svpflow1.dll") -LoadPlugin(PluginPath+"svpflow2.dll") -Import(PluginPath+"InterFrame2.avsi") DirectShowSource("{2}").ConvertToYV12() SetMTMode(2) InterFrame(Cores=Cores, Preset="{3}", Tuning="{4}", FrameDouble={5}, GPU={6}, InputType="{7}"{8}) + + LoadPlugin("{0}") +LoadPlugin("{1}") +Import("{2}") + \ No newline at end of file diff --git a/hfrgen/Properties/Settings.Designer.cs b/hfrgen/Properties/Settings.Designer.cs index 2125569..7ace401 100644 --- a/hfrgen/Properties/Settings.Designer.cs +++ b/hfrgen/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace hfrgen.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -26,12 +26,48 @@ public static Settings Default { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] - public string DirPluginHfr { + public string FilePluginAvsi { get { - return ((string)(this["DirPluginHfr"])); + return ((string)(this["FilePluginAvsi"])); } set { - this["DirPluginHfr"] = value; + this["FilePluginAvsi"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string FilePluginDll1 { + get { + return ((string)(this["FilePluginDll1"])); + } + set { + this["FilePluginDll1"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string FilePluginDll2 { + get { + return ((string)(this["FilePluginDll2"])); + } + set { + this["FilePluginDll2"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool UseFolderPlugin { + get { + return ((bool)(this["UseFolderPlugin"])); + } + set { + this["UseFolderPlugin"] = value; } } } diff --git a/hfrgen/Properties/Settings.settings b/hfrgen/Properties/Settings.settings index 69d16f5..e6bfce6 100644 --- a/hfrgen/Properties/Settings.settings +++ b/hfrgen/Properties/Settings.settings @@ -2,8 +2,17 @@ - + + + + + + + + + False + \ No newline at end of file diff --git a/hfrgen/app.config b/hfrgen/app.config index 5c92615..648fbc8 100644 --- a/hfrgen/app.config +++ b/hfrgen/app.config @@ -7,9 +7,18 @@ - + + + + + + + + + False + \ No newline at end of file diff --git a/hfrgen/frmMain.cs b/hfrgen/frmMain.cs index 0702235..f011460 100644 --- a/hfrgen/frmMain.cs +++ b/hfrgen/frmMain.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; using System.IO; -using System.Linq; using System.Text; using System.Windows.Forms; @@ -21,7 +16,7 @@ public partial class frmMain : Form public frmMain(string file, string lang) // API, a value received from host { InitializeComponent(); - this.Icon = Properties.Resources.lightning_go; + Icon = Properties.Resources.lightning_go; _file = file; _fileavs = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file)) + ".avs"; @@ -29,18 +24,56 @@ public frmMain(string file, string lang) // API, a value received from host private void HighFrameRate_Load(object sender, EventArgs e) { - if (String.Equals(Path.GetExtension(_file), ".avs", IC)) + if (string.Equals(Path.GetExtension(_file), ".avs", IC)) { MessageBox.Show("Please select non AviSynth script."); - this.Close(); + Close(); return; } + SettingCheck(); + cboPreset.SelectedIndex = 0; cboTuning.SelectedIndex = 0; cboInputType.SelectedIndex = 0; } + private void frmMain_FormClosing(object sender, FormClosingEventArgs e) + { + if (!Properties.Settings.Default.UseFolderPlugin) + { + SettingCheck(); + } + } + + void SettingCheck() + { + if (string.IsNullOrEmpty(Properties.Settings.Default.FilePluginAvsi)) + Setting("InterFrame2.avsi"); + else if (!File.Exists(Properties.Settings.Default.FilePluginAvsi)) + Setting("InterFrame2.avsi"); + + if (string.IsNullOrEmpty(Properties.Settings.Default.FilePluginDll1)) + Setting("svpflow1.dll"); + else if (!File.Exists(Properties.Settings.Default.FilePluginDll1)) + Setting("svpflow1.dll"); + + if (string.IsNullOrEmpty(Properties.Settings.Default.FilePluginDll2)) + Setting("svpflow2.dll"); + else if (!File.Exists(Properties.Settings.Default.FilePluginDll2)) + Setting("svpflow2.dll"); + } + + void Setting(string file) + { + if (Properties.Settings.Default.UseFolderPlugin) + return; + + MessageBox.Show($"\"{file}\" not found or not configured.\nPlease configure before use."); + Form frm = new frmSetting(); + frm.ShowDialog(); + } + private void cboPreset_SelectedIndexChanged(object sender, EventArgs e) { int i = cboPreset.SelectedIndex; @@ -117,29 +150,33 @@ private void btnSetting_Click(object sender, EventArgs e) private void btnOK_Click(object sender, EventArgs e) { - if (String.IsNullOrEmpty(Properties.Settings.Default.DirPluginHfr)) + string[] Plugin = { - MessageBox.Show("Missing InterFrame AviSynth Autoload Script and Plugins, please settings first before save."); - return; - } + Properties.Settings.Default.FilePluginDll1, + Properties.Settings.Default.FilePluginDll2, + Properties.Settings.Default.FilePluginAvsi + }; + + string[] Data = + { + Properties.Settings.Default.UseFolderPlugin ? "# using installed plugin" : string.Format(Properties.Resources.ScriptPlugin, Plugin), + string.Format("{0}", Environment.ProcessorCount), + _file, + cboPreset.Text, + cboTuning.Text, + chkDoubleFps.Checked ? "true" : "false", + chkUseGPU.Checked ? "true" : "false", + cboInputType.Text, + chkFullFrame.Checked ? ", NewNum=60, NewDen=1" : null + }; - string[] Data = { String.Format("{0}", Environment.ProcessorCount), - Properties.Settings.Default.DirPluginHfr, - _file, - cboPreset.Text, - cboTuning.Text, - chkDoubleFps.Checked ? "true" : "false", - chkUseGPU.Checked ? "true" : "false", - cboInputType.Text, - chkFullFrame.Checked ? ", NewNum=60, NewDen=1" : ""}; - - File.WriteAllText(_fileavs, String.Format(Properties.Resources.ScriptHFR, Data), UTF8); - this.Close(); + File.WriteAllText(_fileavs, string.Format(Properties.Resources.ScriptHFR, Data), UTF8); + Close(); } private void btnCancel_Click(object sender, EventArgs e) { - this.Close(); + Close(); } } } diff --git a/hfrgen/frmMain.designer.cs b/hfrgen/frmMain.designer.cs index 50c0250..5622ba4 100644 --- a/hfrgen/frmMain.designer.cs +++ b/hfrgen/frmMain.designer.cs @@ -256,6 +256,7 @@ private void InitializeComponent() this.Name = "frmMain"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "High Frame Rate (InterFrame)"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing); this.Load += new System.EventHandler(this.HighFrameRate_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); diff --git a/hfrgen/frmSetting.Designer.cs b/hfrgen/frmSetting.Designer.cs index 7db59f9..d41ffcd 100644 --- a/hfrgen/frmSetting.Designer.cs +++ b/hfrgen/frmSetting.Designer.cs @@ -33,13 +33,21 @@ private void InitializeComponent() this.btnOK = new System.Windows.Forms.Button(); this.txtPath = new System.Windows.Forms.TextBox(); this.lblInfo = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtPath2 = new System.Windows.Forms.TextBox(); + this.btnBrowse2 = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.txtPath3 = new System.Windows.Forms.TextBox(); + this.btnBrowse3 = new System.Windows.Forms.Button(); + this.chkUsePluginFolder = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // btnBrowse // this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnBrowse.Image = global::hfrgen.Properties.Resources.drive_magnify; - this.btnBrowse.Location = new System.Drawing.Point(458, 12); + this.btnBrowse.Location = new System.Drawing.Point(492, 25); this.btnBrowse.Name = "btnBrowse"; this.btnBrowse.Size = new System.Drawing.Size(24, 24); this.btnBrowse.TabIndex = 0; @@ -49,7 +57,7 @@ private void InitializeComponent() // btnOK // this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOK.Location = new System.Drawing.Point(407, 112); + this.btnOK.Location = new System.Drawing.Point(441, 205); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 1; @@ -62,10 +70,10 @@ private void InitializeComponent() this.txtPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtPath.Font = new System.Drawing.Font("Tahoma", 10F); - this.txtPath.Location = new System.Drawing.Point(12, 12); + this.txtPath.Location = new System.Drawing.Point(12, 25); this.txtPath.Name = "txtPath"; this.txtPath.ReadOnly = true; - this.txtPath.Size = new System.Drawing.Size(440, 24); + this.txtPath.Size = new System.Drawing.Size(474, 24); this.txtPath.TabIndex = 2; // // lblInfo @@ -73,18 +81,110 @@ private void InitializeComponent() this.lblInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblInfo.Location = new System.Drawing.Point(12, 39); + this.lblInfo.Location = new System.Drawing.Point(12, 136); this.lblInfo.Name = "lblInfo"; - this.lblInfo.Size = new System.Drawing.Size(470, 70); + this.lblInfo.Size = new System.Drawing.Size(504, 66); this.lblInfo.TabIndex = 3; this.lblInfo.Text = resources.GetString("lblInfo.Text"); this.lblInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(136, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Path for InterFrame2.avsi:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 52); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(110, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Path for svpflow1.dll:"; + // + // txtPath2 + // + this.txtPath2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtPath2.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtPath2.Location = new System.Drawing.Point(12, 68); + this.txtPath2.Name = "txtPath2"; + this.txtPath2.ReadOnly = true; + this.txtPath2.Size = new System.Drawing.Size(474, 23); + this.txtPath2.TabIndex = 6; + // + // btnBrowse2 + // + this.btnBrowse2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnBrowse2.Image = global::hfrgen.Properties.Resources.drive_magnify; + this.btnBrowse2.Location = new System.Drawing.Point(492, 68); + this.btnBrowse2.Name = "btnBrowse2"; + this.btnBrowse2.Size = new System.Drawing.Size(24, 23); + this.btnBrowse2.TabIndex = 7; + this.btnBrowse2.UseVisualStyleBackColor = true; + this.btnBrowse2.Click += new System.EventHandler(this.btnBrowse2_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 94); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(110, 13); + this.label3.TabIndex = 8; + this.label3.Text = "Path for svpflow2.dll:"; + // + // txtPath3 + // + this.txtPath3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtPath3.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtPath3.Location = new System.Drawing.Point(12, 110); + this.txtPath3.Name = "txtPath3"; + this.txtPath3.ReadOnly = true; + this.txtPath3.Size = new System.Drawing.Size(474, 23); + this.txtPath3.TabIndex = 9; + // + // btnBrowse3 + // + this.btnBrowse3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnBrowse3.Image = global::hfrgen.Properties.Resources.drive_magnify; + this.btnBrowse3.Location = new System.Drawing.Point(492, 110); + this.btnBrowse3.Name = "btnBrowse3"; + this.btnBrowse3.Size = new System.Drawing.Size(23, 23); + this.btnBrowse3.TabIndex = 10; + this.btnBrowse3.UseVisualStyleBackColor = true; + this.btnBrowse3.Click += new System.EventHandler(this.btnBrowse3_Click); + // + // chkUsePluginFolder + // + this.chkUsePluginFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.chkUsePluginFolder.AutoSize = true; + this.chkUsePluginFolder.Location = new System.Drawing.Point(12, 209); + this.chkUsePluginFolder.Name = "chkUsePluginFolder"; + this.chkUsePluginFolder.Size = new System.Drawing.Size(414, 17); + this.chkUsePluginFolder.TabIndex = 11; + this.chkUsePluginFolder.Text = "&These files has been installed on AviSynth plugin folder, thus no need to browse" + + "."; + this.chkUsePluginFolder.UseVisualStyleBackColor = true; + this.chkUsePluginFolder.CheckedChanged += new System.EventHandler(this.chkUsePluginFolder_CheckedChanged); + // // frmSetting // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(494, 147); + this.ClientSize = new System.Drawing.Size(528, 240); + this.Controls.Add(this.chkUsePluginFolder); + this.Controls.Add(this.btnBrowse3); + this.Controls.Add(this.txtPath3); + this.Controls.Add(this.label3); + this.Controls.Add(this.btnBrowse2); + this.Controls.Add(this.txtPath2); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.Controls.Add(this.lblInfo); this.Controls.Add(this.txtPath); this.Controls.Add(this.btnOK); @@ -105,5 +205,13 @@ private void InitializeComponent() private System.Windows.Forms.Button btnOK; private System.Windows.Forms.TextBox txtPath; private System.Windows.Forms.Label lblInfo; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtPath2; + private System.Windows.Forms.Button btnBrowse2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtPath3; + private System.Windows.Forms.Button btnBrowse3; + private System.Windows.Forms.CheckBox chkUsePluginFolder; } } \ No newline at end of file diff --git a/hfrgen/frmSetting.cs b/hfrgen/frmSetting.cs index 380dea0..b576086 100644 --- a/hfrgen/frmSetting.cs +++ b/hfrgen/frmSetting.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; using System.IO; -using System.Linq; -using System.Text; using System.Windows.Forms; +using static hfrgen.Properties.Settings; + namespace hfrgen { public partial class frmSetting : Form @@ -15,38 +11,75 @@ public partial class frmSetting : Form public frmSetting() { InitializeComponent(); - this.Icon = Properties.Resources.lightning_go; + Icon = Properties.Resources.lightning_go; } private void frmSetting_Load(object sender, EventArgs e) { - txtPath.Text = Properties.Settings.Default.DirPluginHfr; + txtPath.Text = Default.FilePluginAvsi; + txtPath2.Text = Default.FilePluginDll1; + txtPath3.Text = Default.FilePluginDll2; + chkUsePluginFolder.Checked = Default.UseFolderPlugin; } private void btnBrowse_Click(object sender, EventArgs e) { OpenFileDialog GetFiles = new OpenFileDialog(); - GetFiles.Filter = "InterFrame2.avsi|InterFrame2.avsi|" + - "svpflow1.dll|svpflow1.dll|" + - "svpflow2.dll|svpflow2.dll"; + GetFiles.Filter = "InterFrame2.avsi|InterFrame2.avsi"; + GetFiles.FilterIndex = 1; + GetFiles.Multiselect = false; + + if (GetFiles.ShowDialog() == DialogResult.OK) + { + txtPath.Text = GetFiles.FileName; + Default.FilePluginAvsi = GetFiles.FileName; + } + } + + private void btnBrowse2_Click(object sender, EventArgs e) + { + OpenFileDialog GetFiles = new OpenFileDialog(); + GetFiles.Filter = "svpflow1.dll|svpflow1.dll"; + GetFiles.FilterIndex = 1; + GetFiles.Multiselect = false; + + if (GetFiles.ShowDialog() == DialogResult.OK) + { + txtPath2.Text = GetFiles.FileName; + Default.FilePluginDll1 = GetFiles.FileName; + } + } + + private void btnBrowse3_Click(object sender, EventArgs e) + { + OpenFileDialog GetFiles = new OpenFileDialog(); + GetFiles.Filter = "svpflow2.dll|svpflow2.dll"; GetFiles.FilterIndex = 1; GetFiles.Multiselect = false; if (GetFiles.ShowDialog() == DialogResult.OK) { - foreach (var item in GetFiles.FileNames) - { - txtPath.Text = Path.GetDirectoryName(item); - Properties.Settings.Default.DirPluginHfr = Path.GetDirectoryName(item); - Properties.Settings.Default.Save(); - break; - } + txtPath3.Text = GetFiles.FileName; + Default.FilePluginDll2 = GetFiles.FileName; } } + private void chkUsePluginFolder_CheckedChanged(object sender, EventArgs e) + { + var x = chkUsePluginFolder.Checked; + Default.UseFolderPlugin = x; + txtPath.Enabled = !x; + txtPath2.Enabled = !x; + txtPath3.Enabled = !x; + btnBrowse.Enabled = !x; + btnBrowse2.Enabled = !x; + btnBrowse3.Enabled = !x; + } + private void btnOK_Click(object sender, EventArgs e) { - this.Close(); + Default.Save(); + Close(); } } }