Esempio n. 1
0
        public void OpenDocument()
        {
            if (_document.IsDirty)
            {
                DialogResult result = _mainView.AskSaving();
                if (result == DialogResult.Yes)
                {
                    SaveDocument();
                }
                else if (result == DialogResult.Cancel)
                {
                    return;
                }
            }
            string filePath;
            bool   ok = _mainView.AskForFilePathToOpen(out filePath);

            if (ok)
            {
                try
                {
                    _document.Load(filePath);
                }
                catch (Exception e)
                {
                    _mainView.ShowMessageBox(e.Message);
                }
            }
        }