本文整理汇总了C#中MatterHackers.MatterControl.DataStorage.PrintItemCollection类的典型用法代码示例。如果您正苦于以下问题:C# PrintItemCollection类的具体用法?C# PrintItemCollection怎么用?C# PrintItemCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PrintItemCollection类属于MatterHackers.MatterControl.DataStorage命名空间,在下文中一共展示了PrintItemCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:fitzsimk,项目名称:MatterControl,代码行数:25,代码来源:LibraryProviderSqlite.cs
示例2: LibraryRowItemCollection
public LibraryRowItemCollection(PrintItemCollection collection, LibraryDataView libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
: base(libraryDataView, thumbnailWidget)
{
this.parentProvider = parentProvider;
this.printItemCollection = collection;
CreateGuiElements();
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:7,代码来源:LibraryRowItemCollection.cs
示例3: LibraryProviderQueue
public LibraryProviderQueue(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
this.baseLibraryCollection = baseLibraryCollection;
QueueData.Instance.ItemAdded.RegisterEvent((sender, e) => OnDataReloaded(null), ref unregisterEvent);
}
开发者ID:sizanjavad,项目名称:MatterControl,代码行数:7,代码来源:LibraryProviderQueue.cs
示例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();
}
开发者ID:ddpruitt,项目名称:MatterControl,代码行数:11,代码来源:LibraryRowItemCollection.cs
示例5: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection2(this);
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:11,代码来源:LibraryProviderSqlite.cs
示例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();
}
开发者ID:CodeMangler,项目名称:MatterControl,代码行数:12,代码来源:LibrarySelectorRowItem.cs
示例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();
}
开发者ID:sizanjavad,项目名称:MatterControl,代码行数:13,代码来源:LibraryProviderSqlite.cs
示例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();
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:14,代码来源:LibraryProviderSqlite.cs
示例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);
}
开发者ID:ChapmanCPSC370,项目名称:MatterControl,代码行数:15,代码来源:LibraryProviderSqlite.cs
示例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);
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:17,代码来源:LibraryProviderSqlite.cs
示例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();
}
开发者ID:ChapmanCPSC370,项目名称:MatterControl,代码行数:20,代码来源:LibraryRowItemCollection.cs
示例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;
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:30,代码来源:LibraryDataView.cs
示例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;
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:22,代码来源:LibraryProviderSqlite.cs
示例14: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderSQLite(collection, setCurrentLibraryProvider, this, collection.Name);
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:4,代码来源:LibraryProviderSqlite.cs
示例15: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderQueue(collection, this);
}
开发者ID:sizanjavad,项目名称:MatterControl,代码行数:4,代码来源:LibraryProviderQueue.cs
示例16: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderHistory(collection, this, SetCurrentLibraryProvider);
}
开发者ID:fitzsimk,项目名称:MatterControl,代码行数:4,代码来源:LibraryProviderHistory.cs
示例17: GetRootLibraryCollection2
static PrintItemCollection GetRootLibraryCollection2(LibraryProviderSQLite rootLibrary)
{
// 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();
// Preload library with Oem supplied list of default parts
string[] itemsToAdd = SyncCalibrationFilesToDisk(OemSettings.Instance.PreloadedLibraryFiles);
if (itemsToAdd.Length > 0)
{
// Import any files sync'd to disk into the library, then add them to the queue
rootLibrary.AddFilesToLibrary(itemsToAdd);
}
}
return rootLibraryCollection;
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:23,代码来源:LibraryProviderSqlite.cs
示例18: AddAllItems
private void AddAllItems(object inData = null)
{
// Clear SelectedItems when the list is rebuilt to prevent duplicate entries
this.SelectedItems.Clear();
topToBottomItemList.RemoveAllChildren();
var provider = this.CurrentLibraryProvider;
if (provider != null)
{
if (provider.ProviderKey != LibraryProviderSelector.ProviderKeyName)
{
// Create logical "up folder" entry
PrintItemCollection parent = new PrintItemCollection("..", provider.ProviderKey);
LibraryRowItem queueItem = new LibraryRowItemCollection(parent, provider, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(provider.ParentLibraryProvider, parent, LibraryProvider.UpFolderImage), "Back".Localize());
queueItem.IsViewHelperItem = true;
AddListItemToTopToBottom(queueItem);
}
for (int i = 0; i < provider.CollectionCount; i++)
{
PrintItemCollection item = provider.GetCollectionItem(i);
LibraryRowItem queueItem = new LibraryRowItemCollection(item, provider, i, this, null, GetThumbnailWidget(null, item, provider.GetCollectionFolderImage(i)), "Open".Localize());
AddListItemToTopToBottom(queueItem);
}
for (int i = 0; i < provider.ItemCount; i++)
{
GuiWidget thumbnailWidget = provider.GetItemThumbnail(i);
LibraryRowItem queueItem = new LibraryRowItemPart(provider, i, this, thumbnailWidget);
AddListItemToTopToBottom(queueItem);
}
}
LastScrollPosition scrollPosition = inData as LastScrollPosition;
if (scrollPosition != null)
{
this.TopLeftOffset = scrollPosition.topLeftScrollPosition;
}
}
开发者ID:ChapmanCPSC370,项目名称:MatterControl,代码行数:41,代码来源:LibraryDataView.cs
示例19: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
foreach (LibraryProvider libraryProvider in libraryProviders)
{
if (collection.Key == libraryProvider.ProviderKey)
{
return libraryProvider;
}
}
throw new NotImplementedException();
}
开发者ID:CodeMangler,项目名称:MatterControl,代码行数:12,代码来源:LibraryProviderSelector.cs
示例20: GetProviderForCollection
public override LibraryProvider GetProviderForCollection(PrintItemCollection collection)
{
return new LibraryProviderFileSystem(Path.Combine(rootPath, collection.Key), collection.Name, this);
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:4,代码来源:LibraryProviderFileSystem.cs
注:本文中的MatterHackers.MatterControl.DataStorage.PrintItemCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论