Пример #1
0
        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);
        }
Пример #2
0
        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);
                }
            }
        }