Пример #1
0
        private IEnumerable<ActionParticipant> SetupParty(FileAccessor fileAccessor)
        {
            var result = System.Windows.MessageBox.Show("Load a party?", "Load?", MessageBoxButton.YesNo);
            if (result == MessageBoxResult.Yes)
            {
                var partyFileName = GetPartyFileNameFromUser(fileAccessor);
                return fileAccessor.LoadParty(partyFileName);

            }
            else
            {
                var partyFileName = SaveNewParty(fileAccessor);

                if (String.IsNullOrEmpty(partyFileName))
                {
                    System.Windows.MessageBox.Show("No party file selected. Cannot continue operations. Closing program.", "Error: No Party File to Auto Save To", MessageBoxButton.OK);
                    Close();
                }

                var party = new List<ActionParticipant>();
                fileAccessor.SaveParty(party, partyFileName);

                return party;
            }
        }