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


C# DataStorage.PrintItemCollection类代码示例

本文整理汇总了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;
		}
开发者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


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