コード例 #1
0
ファイル: StlExport.cs プロジェクト: yg12344/MatterControl
        public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken)
        {
            if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem)
            {
                return(MeshExport.ExportMesh(libraryItem, outputPath));
            }

            return(Task.FromResult(false));
        }
コード例 #2
0
        public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath)
        {
            if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem)
            {
                return(MeshExport.ExportMesh(libraryItem, outputPath));
            }

            return(Task.FromResult(false));
        }
コード例 #3
0
ファイル: StlExport.cs プロジェクト: alvaroiba/MatterControl
        public async Task <List <ValidationError> > Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken)
        {
            var firstItem = libraryItems.OfType <ILibraryAsset>().FirstOrDefault();

            if (firstItem is ILibraryAsset libraryItem)
            {
                if (MeshExport.ExportMesh(libraryItem, outputPath).Result)
                {
                    return(null);
                }
            }

            return(new List <ValidationError>()
            {
                new ValidationError()
                {
                    Error = "Item cannot be exported as STL".Localize(),
                    Details = firstItem?.ToString() ?? ""
                }
            });
        }