/// <summary> /// Метод обновления данных полей отвечающих за декодировку /// </summary> private void UpdateDecode(DataSaver dataSaver) { pictureBoxDecode.SizeMode = PictureBoxSizeMode.StretchImage; richTextBoxDecode.Text = dataSaver.text; labelPathDecode.Text = dataSaver.path; pictureBoxDecode.Image = dataSaver.img; }
/// <summary> /// Кнопка "Выход" /// </summary> private void ExitToolStripMenuItem_Click(object sender, EventArgs e) { if (SettingsForm.SaveWhenQuit) { DataSaver dataSaverEncode = new DataSaver(richTextBoxEncode.Text, labelPathEncode.Text, pictureBoxEncode.Image); Loader.Save(dataSaverEncode, Loader.pathEncode); DataSaver dataSaverDecode = new DataSaver(richTextBoxDecode.Text, labelPathDecode.Text, pictureBoxDecode.Image); Loader.Save(dataSaverDecode, Loader.pathDecode); } Close(); }
public MainForm() { InitializeComponent(); DataSaver dataEncode = (DataSaver)Loader.Upload(Loader.pathEncode); UpdateEncode(dataEncode); DataSaver dataDecode = (DataSaver)Loader.Upload(Loader.pathDecode); UpdateDecode(dataDecode); openFileEncode = new OpenFileDialog(); openFileEncode.Filter = "(*.jpg;*.png)|*.jpg;*.png;"; openFileDecode = new OpenFileDialog(); openFileDecode.Filter = "(*.jpg;*.png)|*.jpg;*.png;"; coder = new Coder(pictureBoxDecode, richTextBoxDecode, pictureBoxEncode, richTextBoxEncode); }