当前位置: 首页>>代码示例>>C#>>正文


C# PrintItemCollection.Commit方法代码示例

本文整理汇总了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();
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:4,代码来源:LibrarySQLiteData.cs

示例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;
		}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:22,代码来源:LibraryProviderSqlite.cs

示例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;
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:23,代码来源:LibraryProviderSqlite.cs

示例4: AddCollectionToLibrary

		public override void AddCollectionToLibrary(string collectionName)
		{
			PrintItemCollection newCollection = new PrintItemCollection(collectionName, "");
			newCollection.ParentCollectionID = baseLibraryCollection.Id;
			newCollection.Commit();
			LoadLibraryItems();
		}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:7,代码来源:LibraryProviderSqlite.cs

示例5: AddCollectionToLibraryAsync

		public async Task AddCollectionToLibraryAsync(string collectionName)
		{
			PrintItemCollection newCollection = new PrintItemCollection(collectionName, "");
			newCollection.ParentCollectionID = baseLibraryCollection.Id;
			newCollection.Commit();
			await LoadLibraryItems();
		}
开发者ID:fitzsimk,项目名称:MatterControl,代码行数:7,代码来源:LibraryProviderSqlite.cs


注:本文中的MatterHackers.MatterControl.DataStorage.PrintItemCollection.Commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。