private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_goingToAnotherVersion)
            {
                DocumentWindow documentWindow = new DocumentWindow(_document, _followingVersion, _readingInTheDeveloperMode, _readingFromEditDocumentWindow, _readingFromUserDetailsWindow, _userWhoReads, _userWhoWatchedWhoReads);

                documentWindow.Show();
            }
            else if (_readingFromUserDetailsWindow)
            {
                UserDetailsWindow userDetailsWindow = new UserDetailsWindow(_userWhoReads, _userWhoWatchedWhoReads);

                userDetailsWindow.Show();
            }
            else if (_readingFromEditDocumentWindow && _readingInTheDeveloperMode)
            {
                EditDocumentWindow editDocumentWindow = new EditDocumentWindow(_document, _userWhoReads);

                editDocumentWindow.Show();
            }
            else if (_readingInTheDeveloperMode)
            {
                AllDocumentsWindow allDocumentsWindow = new AllDocumentsWindow(_userWhoReads);

                allDocumentsWindow.Show();
            }
            else
            {
                AllDocumentsWindow allDocumentsWindow = new AllDocumentsWindow();

                allDocumentsWindow.Show();
            }
        }
예제 #2
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_goingToRead)
            {
                if (_lookingInTheDeveloperMode)
                {
                    DocumentWindow documentWindow = new DocumentWindow(_documentForReadingOrEditing, _userWhoWatches);

                    documentWindow.Show();
                }
                else
                {
                    DocumentWindow documentWindow = new DocumentWindow(_documentForReadingOrEditing);

                    documentWindow.Show();
                }
            }
            else if (_goingToEdit)
            {
                EditDocumentWindow editDocumentWindow = new EditDocumentWindow(_documentForReadingOrEditing, _userWhoWatches);

                editDocumentWindow.Show();
            }
            else
            {
                if (_lookingInTheDeveloperMode)
                {
                    ProfileWindow profileWindow = new ProfileWindow(_userWhoWatches);

                    profileWindow.Show();
                }
                else
                {
                    MainWindow mainWindow = new MainWindow();

                    mainWindow.Show();
                }
            }
        }