示例#1
0
 private void SetSelectedCurve(CurveLibraryRecord clr)
 {
     if (comboBoxSource.SelectedIndex == 1)
     {
         _curveLibrary.Import(clr);
     }
     SelectedCurve = clr.CurveData;
 }
 private static void ExportRecordsToFile(IEnumerable<CurveLibraryRecord> records, string filePath)
 {
     if (File.Exists(filePath)) {
         File.Delete(filePath);
     }
     using (var library = new CurveLibrary(filePath)) {
         foreach (var record in records) {
             library.Import(record);
         }
         library.Save();
     }
 }
示例#3
0
 private static void ExportRecordsToFile(IEnumerable <CurveLibraryRecord> records, string filePath)
 {
     if (File.Exists(filePath))
     {
         File.Delete(filePath);
     }
     using (var library = new CurveLibrary(filePath)) {
         foreach (var record in records)
         {
             library.Import(record);
         }
         library.Save();
     }
 }
示例#4
0
 private void buttonExportToLibrary_Click(object sender, EventArgs e)
 {
     if (comboBoxExport.SelectedIndex == 0)
     {
         using (var library = new CurveLibrary()) {
             var dialog = new CurveLibraryRecordEditDialog(null);
             if (dialog.ShowDialog() == DialogResult.OK)
             {
                 var libraryRecord = dialog.LibraryRecord;
                 libraryRecord.CurveData = _points;
                 library.Import(libraryRecord);
                 library.Save();
             }
             dialog.Dispose();
         }
     }
     else
     {
         var dialog2 = new CurveFileImportExportDialog(CurveFileImportExportDialog.ImportExport.Export);
         dialog2.ShowDialog();
         dialog2.Dispose();
     }
 }
示例#5
0
 private void buttonExportToLibrary_Click(object sender, EventArgs e)
 {
     if (comboBoxExport.SelectedIndex == 0) {
         using (var library = new CurveLibrary()) {
             var dialog = new CurveLibraryRecordEditDialog(null);
             if (dialog.ShowDialog() == DialogResult.OK) {
                 var libraryRecord = dialog.LibraryRecord;
                 libraryRecord.CurveData = _points;
                 library.Import(libraryRecord);
                 library.Save();
             }
             dialog.Dispose();
         }
     }
     else {
         var dialog2 = new CurveFileImportExportDialog(CurveFileImportExportDialog.ImportExport.Export);
         dialog2.ShowDialog();
         dialog2.Dispose();
     }
 }