BEurtle.IssueDetail.SaveAttachment_Click C# (CSharp) Метод

SaveAttachment_Click() приватный Метод

private SaveAttachment_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void SaveAttachment_Click(object sender, EventArgs e)
        {
            try
            {
                var ext = MIMETypesDictionary.ContainsKey(DraggableIcon.Items[0].Text) ? MIMETypesDictionary[DraggableIcon.Items[0].Text] : "bin";
                saveFileDialog.DefaultExt = ext;
                saveFileDialog.FileName = "comment." + ext;
                saveFileDialog.Filter = DraggableIcon.Items[0].Text + " (*." + ext + ")|" + ext;
                if (DialogResult.OK == saveFileDialog.ShowDialog())
                {
                    using (var s = saveFileDialog.OpenFile())
                        SaveAsFile(s);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Error when saving file: " + ex.ToString(), "Error from BEurtle", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }