|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using DataPersistence;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ConsoleApp.Menu
|
|
|
|
namespace ConsoleApp.Menu
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -22,10 +23,20 @@ namespace ConsoleApp.Menu
|
|
|
|
throw new ArgumentNullException();
|
|
|
|
throw new ArgumentNullException();
|
|
|
|
|
|
|
|
|
|
|
|
Recipe recipe = CurrentSelected;
|
|
|
|
Recipe recipe = CurrentSelected;
|
|
|
|
|
|
|
|
string path = $"export_{string.Concat(CurrentSelected.Title.Where(c => !char.IsWhiteSpace(c)))}";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -- trying to put the right extention by checking the type of the DataManager...
|
|
|
|
|
|
|
|
//if (object.ReferenceEquals(_masterMgr.DataMgr.GetType(), typeof(DataContractXML)))
|
|
|
|
|
|
|
|
// path += ".xml";
|
|
|
|
|
|
|
|
//else if (object.ReferenceEquals(_masterMgr.DataMgr.GetType(), typeof(DataContractJSON)))
|
|
|
|
|
|
|
|
// path += ".json";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path += ".xml";
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_masterMgr.DataMgr.Export(recipe, "");
|
|
|
|
|
|
|
|
|
|
|
|
_masterMgr.DataMgr.Export(recipe, path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (ArgumentNullException e)
|
|
|
|
catch (ArgumentNullException e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|