本文整理汇总了C#中MatterHackers.MatterControl.DataStorage.PrintItemCollection.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# PrintItemCollection.Commit方法的具体用法?C# PrintItemCollection.Commit怎么用?C# PrintItemCollection.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatterHackers.MatterControl.DataStorage.PrintItemCollection
的用法示例。
在下文中一共展示了PrintItemCollection.Commit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddCollection
public void AddCollection(PrintItemCollection collection)
{
collection.Commit();
}
示例2: 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;
}
示例3: 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;
}
示例4: AddCollectionToLibrary
public override void AddCollectionToLibrary(string collectionName)
{
PrintItemCollection newCollection = new PrintItemCollection(collectionName, "");
newCollection.ParentCollectionID = baseLibraryCollection.Id;
newCollection.Commit();
LoadLibraryItems();
}
示例5: AddCollectionToLibraryAsync
public async Task AddCollectionToLibraryAsync(string collectionName)
{
PrintItemCollection newCollection = new PrintItemCollection(collectionName, "");
newCollection.ParentCollectionID = baseLibraryCollection.Id;
newCollection.Commit();
await LoadLibraryItems();
}