using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace Tester { public partial class UpdateBINPanel : UserControl, IExecutePanel { public UpdateBINPanel() { InitializeComponent(); } private void btnFile_Click(object sender, EventArgs e) { using (var fileDialog = new OpenFileDialog()) { fileDialog.FileName = txtFilePath.Text; if (fileDialog.ShowDialog() == DialogResult.OK) { txtFilePath.Text = fileDialog.FileName; } } } private byte[] GetBodyData() { var path = txtFilePath.Text; if (!string.IsNullOrEmpty(path)) { return File.ReadAllBytes(path); } return null; } public object[] GetObjectArg() { var res = new List(); res.Add(txtResPath.Text); res.Add(txtDate.Text); res.Add(txtCntentType.Text); res.Add(GetBodyData()); res.Add(string.IsNullOrEmpty(txtNewDate.Text) ? null : txtNewDate.Text); res.Add(string.IsNullOrEmpty(txtCmp.Text) ? null : txtCmp.Text); return res.ToArray(); } } }