Exemplo n.º 1
0
        private void OnExportToCSV(object sender, EventArgs args)
        {
            string id = ((LogGraphCurveItem)((ToolStripMenuItem)sender).Tag).ItemID;

            using (SaveFileDialog dlg = new SaveFileDialog())
            {
                dlg.Title      = Resources.ExportCSVSpecifyFile;
                dlg.DefaultExt = "*.csv";
                dlg.Filter     = Resources.ExportCSVFilter;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        m_ItemDatabase.ExportToCSV(dlg.FileName, id, ',');
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, Resources.ExportCSVFailed);
                    }
                }
            }
        }