/// <summary> /// /// </summary> /// <returns></returns> private Preset buildPreset() { Preset pre = null; if (this.cboPresetname.Text != "") { pre = new Preset(); pre.Name = this.cboPresetname.Text; pre.Category = this.cboPresetCategory.Text; pre.Description = this.txtDescription.Text; pre.Extension = this.cboFileExtension.Text; if (this.txtDirectory.Text != "") { if (this.txtDirectory.Text[this.txtDirectory.Text.Length -1] != '\\') { pre.OutputFolder = this.txtDirectory.Text + "\\"; } else { pre.OutputFolder = this.txtDirectory.Text; } } else { pre.OutputFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\"; } CommandLineOptions preoptions = new CommandLineOptions(); // get the commandlineoptions... foreach (DataGridViewRow r in this.datagridArguments.Rows) { string stt = ""; if (r.Cells[1].Value != null) { stt = r.Cells[1].Value.ToString(); } if (r.Cells[0].Value != null) { CommandOption opt = new CommandOption( r.Cells[0].Value.ToString(), stt); preoptions.Add(opt); } } pre.CommandLineOptions = preoptions; } return pre; }
private void init() { name = null; category = null; description = null; extension = null; timesused = 0; dateused = DateTime.MinValue; foldername = Path.GetDirectoryName(Assembly.GetCallingAssembly().GetName().CodeBase); commandlineoptions = new CommandLineOptions(); }