Made it possible to get the item count and collection count on collection children.

This commit is contained in:
Lars Brubaker 2015-07-23 10:40:36 -07:00
parent dd626569f9
commit 0d5c8c4cc1
4 changed files with 61 additions and 30 deletions

View file

@ -110,6 +110,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
public abstract Task<PrintItemWrapper> GetPrintItemWrapperAsync(int itemIndex, ReportProgressRatio reportProgress = null);
// TODO: make this asnyc
//public abstract Task<LibraryProvider> GetProviderForCollectionAsync(PrintItemCollection collection);
public abstract LibraryProvider GetProviderForCollection(PrintItemCollection collection);
public abstract void RemoveCollection(int collectionIndexToRemove);
@ -149,6 +150,16 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
var printItemWrapper = GetPrintItemWrapperAsync(printItemIndex).Result;
return new PartThumbnailWidget(printItemWrapper, "part_icon_transparent_40x40.png", "building_thumbnail_40x40.png", PartThumbnailWidget.ImageSizes.Size50x50);
}
public virtual int GetCollectionChildCollectionCount(int collectionIndex)
{
return GetProviderForCollection(GetCollectionItem(collectionIndex)).CollectionCount;
}
public virtual int GetCollectionItemCount(int collectionIndex)
{
return GetProviderForCollection(GetCollectionItem(collectionIndex)).ItemCount;
}
}
public class ProviderLocatorNode