public void clone(classParameter param) { Type t = typeof(classParameter); PropertyInfo[] members = t.GetProperties(); foreach (PropertyInfo p in members) { if (p.CanWrite && p.CanRead) { t.InvokeMember(p.Name, BindingFlags.SetProperty, null, this, new object[] { t.InvokeMember(p.Name, BindingFlags.GetProperty, null, param, null) }); } } }
public FormMain() { InitializeComponent(); buttonConvert.Enabled = false; // Drag & Drop //lvFileList.Dock = DockStyle.Fill; lvFileList.AllowDrop = true; lvFileList.DragEnter += new DragEventHandler(listbox1_DragEnter); lvFileList.DragDrop += new DragEventHandler(listbox1_DragDrop); this.Controls.Add(lvFileList); // ListView 項目追加 //http://www.atmarkit.co.jp/fdotnet/dotnettips/258listviewadd/listviewadd.html // ListViewコントロールのプロパティを設定 lvFileList.GridLines = true; lvFileList.Sorting = SortOrder.Ascending; lvFileList.View = View.Details; // 列(コラム)ヘッダの作成 columnName = new ColumnHeader(); columnType = new ColumnHeader(); columnData = new ColumnHeader(); columnName.Text = "FLV"; columnName.Width = (int)((double)lvFileList.Width * 0.38); columnType.Text = "MP3"; columnType.Width = (int)((double)lvFileList.Width * 0.38); columnData.Text = "状態"; columnData.Width = (int)((double)lvFileList.Width * 0.2); ColumnHeader[] colHeaderRegValue = { this.columnName, this.columnType, this.columnData }; lvFileList.Columns.AddRange(colHeaderRegValue); settingForm_ = new FormSetting(); parameter_ = new classParameter(); parameter_.load(); convertManager = new classConvertManager(); convertManager.parameter = parameter_; convertManager.callback = this.setFlv2ConvertReuslt; convertManager.completeCallback = this.completeCallback; buttonConvert.Enabled = (lvFileList.Items.Count > 0); flvListSaveToolStripMenuItem.Enabled = (lvFileList.Items.Count > 0); flvListClearToolStripMenuItem.Enabled = (lvFileList.Items.Count > 0); }
public classParameter(classParameter param) { this.clone(param); }
private void buttonOK_Click(object sender, EventArgs e) { // パラメタ変数に設定内容を入れる // ファイル読み込み時の処理 if (radioButtonReadOnMemory.Checked) { parameter_.readMode = classDataReader.MODE.ONMEMORY; } else { parameter_.readMode = classDataReader.MODE.FILE; } // ファイル書き込み時の処理 if (radioButtonWriteOnMemory.Checked) { parameter_.writeMode = classDataWriter.MODE.ONMEMORY; } else { parameter_.writeMode = classDataWriter.MODE.FILE; } // MP3ファイル出力先の指定 if (radioButtonOutputSameDir.Checked) { parameter_.outoutdir_mode = classParameter.OUTPUTDIR_MODE.SAMEDIR; } else { parameter_.outoutdir_mode = classParameter.OUTPUTDIR_MODE.SETTINGDIR; } parameter_.outputDir = textBoxOutpuDir.Text; // ファイルの出力 if (radioButtonOutputFileOverwrite.Checked) { parameter_.outputfile_mode = classParameter.OUTPUTFILE_MODE.OVERWRITE; } else { parameter_.outputfile_mode = classParameter.OUTPUTFILE_MODE.SKIP; } // ドラッグ&ドロップ時の処理 if (radioButtonDragDropAddAndWait.Checked) { parameter_.dorp_mode = classParameter.DROP_MODE.BUNDLE; } else { parameter_.dorp_mode = classParameter.DROP_MODE.IMMEDIATE; } if (radioButtonDoneDisplayDialog.Checked) { parameter_.finished_mode = classParameter.FINISHEDCONVERT_MODE.DISPLAYDIALOG; } else if (radioButtonDoneSuspendSleep.Checked) { parameter_.finished_mode = classParameter.FINISHEDCONVERT_MODE.SUSPEND; } else if (radioButtonDoneShutdown.Checked) { parameter_.finished_mode = classParameter.FINISHEDCONVERT_MODE.SHUTDOWN; } else { parameter_.finished_mode = classParameter.FINISHEDCONVERT_MODE.NONOTICE; } // ダブルクリック時の処理 if (radioButtonDoubleClickStartConvert.Checked) { parameter_.doubleclick_mode = classParameter.DOBULCLICK_MODE.STARTCONVERT; } else { parameter_.doubleclick_mode = classParameter.DOBULCLICK_MODE.CHANGEMP3FILENAME; } classParameter p = new classParameter(parameter_); parameter_.save(); this.Close(); }