本文整理汇总了C#中MatterHackers.MatterControl.DataStorage.PrintItemCollection类的典型用法代码示例。如果您正苦于以下问题:C# PrintItemCollection类的具体用法?C# PrintItemCollection怎么用?C# PrintItemCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PrintItemCollection类属于MatterHackers.MatterControl.DataStorage命名空间,在下文中一共展示了PrintItemCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, Action<LibraryProvider> setCurrentLibraryProvider, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider, setCurrentLibraryProvider)
{
this.Name = visibleName;
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection().Result;
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
sqliteDatabaseWatcher.Path = Path.GetDirectoryName(ApplicationDataStorage.Instance.DatastorePath);
sqliteDatabaseWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
| NotifyFilters.FileName | NotifyFilters.DirectoryName;
sqliteDatabaseWatcher.Changed += DatabaseFileChange;
sqliteDatabaseWatcher.Created += DatabaseFileChange;
sqliteDatabaseWatcher.Deleted += DatabaseFileChange;
sqliteDatabaseWatcher.Renamed += DatabaseFileChange;
// Begin watching.
sqliteDatabaseWatcher.EnableRaisingEvents = true;
}
示例2: LibraryRowItemCollection
public LibraryRowItemCollection(PrintItemCollection collection, LibraryDataView libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
: base(libraryDataView, thumbnailWidget)
{
this.parentProvider = parentProvider;
this.printItemCollection = collection;
CreateGuiElements();
}
示例3: LibraryProviderQueue
public LibraryProviderQueue(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
this.baseLibraryCollection = baseLibraryCollection;
QueueData.Instance.ItemAdded.RegisterEvent((sender, e) => OnDataReloaded(null), ref unregisterEvent);
}
示例4: LibraryRowItemCollection
public LibraryRowItemCollection(PrintItemCollection collection, LibraryProvider currentProvider, int collectionIndex, LibraryDataView libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
: base(libraryDataView, thumbnailWidget)
{
this.currentProvider = currentProvider;
this.CollectionIndex = collectionIndex;
this.parentProvider = parentProvider;
this.printItemCollection = collection;
this.ItemName = printItemCollection.Name;
CreateGuiElements();
}
示例5: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection2(this);
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
示例6: LibrarySelectorRowItem
public LibrarySelectorRowItem(PrintItemCollection collection, int collectionIndex, LibrarySelectorWidget libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
{
this.thumbnailWidget = thumbnailWidget;
this.libraryDataView = libraryDataView;
this.CollectionIndex = collectionIndex;
this.parentProvider = parentProvider;
this.printItemCollection = collection;
this.ItemName = printItemCollection.Name;
CreateGuiElements();
}
示例7: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider)
{
this.visibleName = visibleName;
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection2(this);
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
示例8: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, Action<LibraryProvider> setCurrentLibraryProvider, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider)
{
this.setCurrentLibraryProvider = setCurrentLibraryProvider;
this.Name = visibleName;
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection().Result;
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
示例9: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, Action<LibraryProvider> setCurrentLibraryProvider, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider, setCurrentLibraryProvider)
{
this.Name = visibleName;
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection().Result;
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
ItemAdded.RegisterEvent(DatabaseFileChange, ref unregisterEvents);
}
示例10: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection callerSuppliedCollection, Action<LibraryProvider> setCurrentLibraryProvider, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider, setCurrentLibraryProvider)
{
this.Name = visibleName;
// Lock ensures that SQLite providers initialized near the same time from different threads (which has been observed during debug)
// will run in a serial fashion and only one instance will construct and assign to .baseLibraryCollection
lock (initializingLock)
{
// Use null coalescing operator to assign either the caller supplied collection or if null, the root library collection
this.baseLibraryCollection = callerSuppliedCollection ?? GetRootLibraryCollection();
}
LoadLibraryItems();
ItemAdded.RegisterEvent(DatabaseFileChange, ref unregisterEvents);
}
示例11: LibraryRowItemCollection
public LibraryRowItemCollection(PrintItemCollection collection, LibraryProvider currentProvider, int collectionIndex, LibraryDataView libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget, string openButtonText)
: base(libraryDataView, thumbnailWidget)
{
this.openButtonText = openButtonText;
this.currentProvider = currentProvider;
this.CollectionIndex = collectionIndex;
this.parentProvider = parentProvider;
this.printItemCollection = collection;
this.ItemName = printItemCollection.Name;
this.Name = this.ItemName + " Row Item Collection";
if (collection.Key == LibraryRowItem.LoadingPlaceholderToken)
{
this.EnableSlideInActions = false;
this.IsViewHelperItem = true;
}
CreateGuiElements();
}
示例12: GetThumbnailWidget
protected GuiWidget GetThumbnailWidget(LibraryProvider parentProvider, PrintItemCollection printItemCollection, ImageBuffer imageBuffer)
{
Vector2 expectedSize = new Vector2((int)(50 * TextWidget.GlobalPointSizeScaleRatio), (int)(50 * TextWidget.GlobalPointSizeScaleRatio));
if (imageBuffer.Width != expectedSize.x)
{
ImageBuffer scaledImageBuffer = new ImageBuffer((int)expectedSize.x, (int)expectedSize.y, 32, new BlenderBGRA());
scaledImageBuffer.NewGraphics2D().Render(imageBuffer, 0, 0, scaledImageBuffer.Width, scaledImageBuffer.Height);
imageBuffer = scaledImageBuffer;
}
ImageWidget folderThumbnail = new ImageWidget(imageBuffer);
folderThumbnail.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor;
Button clickThumbnail = new Button(0, 0, folderThumbnail);
clickThumbnail.Cursor = Cursors.Hand;
clickThumbnail.Click += (sender, e) =>
{
if (parentProvider == null)
{
this.CurrentLibraryProvider = this.CurrentLibraryProvider.GetProviderForCollection(printItemCollection);
}
else
{
this.CurrentLibraryProvider = parentProvider;
}
};
return clickThumbnail;
}
示例13: GetRootLibraryCollection
private async Task<PrintItemCollection> GetRootLibraryCollection()
{
// Attempt to initialize the library from the Datastore if null
PrintItemCollection rootLibraryCollection = Datastore.Instance.dbSQLite.Table<PrintItemCollection>().Where(v => v.Name == "_library").Take(1).FirstOrDefault();
// If the _library collection is still missing, create and populate it with default content
if (rootLibraryCollection == null)
{
rootLibraryCollection = new PrintItemCollection();
rootLibraryCollection.Name = "_library";
rootLibraryCollection.Commit();
// In this case we now need to update the baseLibraryCollection instance member as code that executes
// down this path will attempt to use the property and will exception if its not set
this.baseLibraryCollection = rootLibraryCollection;
// Preload library with Oem supplied list of default parts
await this.EnsureSamplePartsExist(OemSettings.Instance.PreloadedLibraryFiles);
}
return rootLibraryCollection;
}
示例14: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderSQLite(collection, setCurrentLibraryProvider, this, collection.Name);
}
示例15: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderQueue(collection, this);
}