コード例 #1
0
        private void Export()
        {
            Console.Clear();

            var filePath = PathManager.GetNewOrDefaultFilePath();

            while (File.Exists(filePath) && !ConfirmOverwriting())
            {
                filePath = PathManager.Edit(filePath);
            }

            var contactTransporter = ContactWorkerFactory.CreateContactWorker(filePath);

            if (contactTransporter.TryExportTo(filePath, contactList))
            {
                Console.WriteLine(EXPORT_SUCCESSFUL_MESSAGE);
            }
            else
            {
                Console.WriteLine(EXPORT_FAILED_MESSAGE);
                isOperationDone = false;
            }
        }