コード例 #1
0
ファイル: MainForm.cs プロジェクト: hyamw/excelCompare
        private void Save(ExcelWorkbook workbook, VSheet sheet, bool saveAs)
        {
            string outputPath = null;

            if (saveAs)
            {
                SaveFileDialog dialog = new SaveFileDialog();
                dialog.Filter           = FileForm.FILE_FILTER;
                dialog.Title            = "另存为";
                dialog.FileName         = Path.GetFileName(workbook.filePath);
                dialog.InitialDirectory = Path.GetDirectoryName(workbook.filePath);
                dialog.FilterIndex      = FileForm.GetFilterIndex(workbook.filePath);
                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    outputPath = dialog.FileName;
                }
                else
                {
                    return;
                }
            }

            try
            {
                workbook.SaveSheet(sheet, outputPath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString());
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: hyamw/excelCompare
        private void OpenDifference()
        {
            FileForm form = new FileForm();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                LoadExcel(form.leftPath, form.rightPath);
            }
        }