Revise export interface to receive IEnumerable<ILibraryItem>

This commit is contained in:
John Lewin 2017-08-11 23:17:34 -07:00
parent f3e62760ba
commit e6d2f863f1
5 changed files with 37 additions and 19 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2017, Matt Moening, John Lewin
Copyright (c) 2017, Lars Brubaker, John Lewin
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl.Library.Export
@ -48,9 +49,18 @@ namespace MatterHackers.MatterControl.Library.Export
return !libraryContent.IsProtected;
}
public Task<bool> Generate(ILibraryContentStream libraryContent, string outputPath)
public Task<bool> Generate(IEnumerable<ILibraryItem> libraryItems, string outputPath)
{
return MeshExport.ExportMesh(libraryContent, outputPath);
ILibraryContentStream libraryContent = libraryItems.OfType<ILibraryContentStream>().FirstOrDefault();
if (libraryContent != null)
{
return MeshExport.ExportMesh(libraryContent, outputPath);
}
return null;
}
public GuiWidget GetOptionsPanel() => null;
}
}