public Frm_DataViewer(string VCLibsFile) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); DataFilePathes = null; LastFilePath = ""; oConcatData = null; RecordEvents = new List <CS_RecordEvent>(); ViewerBook = new CS_DataViewerBook(); VCLibCollectionPath = VCLibsFile; VCLibraries = null; if (!(VCLibCollectionPath.Equals(""))) { VCLibraries = new CS_VCLibrariesCollection(); VCLibraries.LoadLibrariesList(VCLibCollectionPath); } NextViewerPageKeyId = 1; ContextTabPage = null; Dlg_OpenViewerBook.InitialDirectory = CANStreamTools.MyDocumentPath + "\\CANStream\\Data Viewers"; Dlg_OpenViewerPage.InitialDirectory = CANStreamTools.MyDocumentPath + "\\CANStream\\Data Viewers"; Dlg_SaveViewerBook.InitialDirectory = CANStreamTools.MyDocumentPath + "\\CANStream\\Data Viewers"; Dlg_SaveViewerPage.InitialDirectory = CANStreamTools.MyDocumentPath + "\\CANStream\\Data Viewers"; }
public bool Set_ViewBook(string BookFilePath) { if (!(BookFilePath.Equals(""))) { ViewerBook = new CS_DataViewerBook(); if (ViewerBook.Read_BookFile(BookFilePath)) { Show_DataViewerBook(); return(true); } else { MessageBox.Show("Data viewer book file reading error !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } return(false); }
private void Load_DataViewerBook() { if (ViewerBook.bModified) { DialogResult Rep = MessageBox.Show("The current data viewer book has been modified, do you want save it prior opening a new one ?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); switch (Rep) { case DialogResult.Yes: Save_DataViewerBook(false); break; case DialogResult.No: break; case DialogResult.Cancel: return; } } if (Dlg_OpenViewerBook.ShowDialog().Equals(DialogResult.OK)) { ViewerBook = new CS_DataViewerBook(); if (ViewerBook.Read_BookFile(Dlg_OpenViewerBook.FileName)) { Show_DataViewerBook(); } else { MessageBox.Show("Data viewer book file reading error !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }