本文整理汇总了C#中MatterHackers.MatterControl.PrintLibrary.Provider.LibraryProvider类的典型用法代码示例。如果您正苦于以下问题:C# LibraryProvider类的具体用法?C# LibraryProvider怎么用?C# LibraryProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LibraryProvider类属于MatterHackers.MatterControl.PrintLibrary.Provider命名空间,在下文中一共展示了LibraryProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LibraryDataView
public LibraryDataView()
{
currentLibraryProvider = new LibraryProviderSelector();
currentLibraryProvider.DataReloaded += LibraryDataReloaded;
if (libraryDataViewInstance != null)
{
throw new Exception("There should only ever be one of these, Lars.");
}
libraryDataViewInstance = this;
// set the display attributes
{
this.AnchorAll();
this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
this.ScrollArea.Padding = new BorderDouble(3, 3, 5, 3);
}
ScrollArea.HAnchor = HAnchor.ParentLeftRight;
AutoScroll = true;
topToBottomItemList = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomItemList.HAnchor = HAnchor.ParentLeftRight;
AddChild(topToBottomItemList);
AddAllItems();
}
示例2: LibraryRowItemCollection
public LibraryRowItemCollection(PrintItemCollection collection, LibraryDataView libraryDataView, LibraryProvider parentProvider, GuiWidget thumbnailWidget)
: base(libraryDataView, thumbnailWidget)
{
this.parentProvider = parentProvider;
this.printItemCollection = collection;
CreateGuiElements();
}
示例3: LibraryDataView
public LibraryDataView()
{
// let the application controler know about this window so it can use it to switch library providers if it needs to.
ApplicationController.Instance.CurrentLibraryDataView = this;
currentLibraryProvider = new LibraryProviderSelector(SetCurrentLibraryProvider, false);
currentLibraryProvider.DataReloaded += LibraryDataReloaded;
if (libraryDataViewInstance != null)
{
#if !__ANDROID__ // this is really just for debugging
throw new Exception("There should only ever be one of these, Lars.");
#endif
}
libraryDataViewInstance = this;
// set the display attributes
{
this.AnchorAll();
this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
this.ScrollArea.Padding = new BorderDouble(3);
}
ScrollArea.HAnchor = HAnchor.ParentLeftRight;
AutoScroll = true;
topToBottomItemList = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomItemList.HAnchor = HAnchor.ParentLeftRight;
AddChild(topToBottomItemList);
AddAllItems();
}
示例4: LibraryProviderFileSystem
public LibraryProviderFileSystem(
string rootPath, string name,
LibraryProvider parentLibraryProvider,
Action<LibraryProvider> setCurrentLibraryProvider,
bool useIncrementedNameDuringTypeChange = false)
: base(parentLibraryProvider, setCurrentLibraryProvider)
{
this.Name = name;
this.rootPath = rootPath;
// Indicates if the new AMF file should use the original file name incremented until no name collision occurs
this.useIncrementedNameDuringTypeChange = useIncrementedNameDuringTypeChange;
if (OsInformation.OperatingSystem == OSType.Windows)
{
directoryWatcher = new FileSystemWatcher();
directoryWatcher.Path = rootPath;
directoryWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
| NotifyFilters.FileName | NotifyFilters.DirectoryName;
directoryWatcher.Changed += DiretoryContentsChanged;
directoryWatcher.Created += DiretoryContentsChanged;
directoryWatcher.Deleted += DiretoryContentsChanged;
directoryWatcher.Renamed += DiretoryContentsChanged;
// Begin watching.
directoryWatcher.EnableRaisingEvents = true;
}
GetFilesAndCollectionsInCurrentDirectory();
}
示例5: LibraryProviderQueue
public LibraryProviderQueue(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
this.baseLibraryCollection = baseLibraryCollection;
QueueData.Instance.ItemAdded.RegisterEvent((sender, e) => OnDataReloaded(null), ref unregisterEvent);
}
示例6: 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;
}
示例7: LibraryRowItemPart
public LibraryRowItemPart(LibraryProvider libraryProvider, int itemIndex, LibraryDataView libraryDataView, GuiWidget thumbnailWidget)
: base(libraryDataView, thumbnailWidget)
{
thumbnailWidth = thumbnailWidget.Width;
var widget = thumbnailWidget as IClickable;
if (widget != null)
{
widget.Click += onViewPartClick;
}
this.ItemName = libraryProvider.GetPrintItemName(itemIndex);
if(this.ItemName == LibraryRowItem.LoadingPlaceholderToken)
{
this.ItemName = "Retrieving Contents...".Localize();
this.IsViewHelperItem = true;
this.EnableSlideInActions = false;
}
this.libraryProvider = libraryProvider;
this.ItemIndex = itemIndex;
CreateGuiElements();
AddLoadingProgressBar();
libraryProvider.RegisterForProgress(itemIndex, ReportProgressRatio);
}
示例8: CreateLibraryProvider
public virtual LibraryProvider CreateLibraryProvider(LibraryProvider parentLibraryProvider, Action<LibraryProvider> setCurrentLibraryProvider)
{
return new LibraryProviderFileSystem(
rootPath,
Description,
parentLibraryProvider,
setCurrentLibraryProvider,
this.useIncrementedNameDuringTypeChange);
}
示例9: 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();
}
示例10: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider)
: base(parentLibraryProvider)
{
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection2(this);
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
示例11: 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();
}
示例12: LibraryProviderSQLite
public LibraryProviderSQLite(PrintItemCollection baseLibraryCollection, LibraryProvider parentLibraryProvider, string visibleName)
: base(parentLibraryProvider)
{
this.visibleName = visibleName;
if (baseLibraryCollection == null)
{
baseLibraryCollection = GetRootLibraryCollection2(this);
}
this.baseLibraryCollection = baseLibraryCollection;
LoadLibraryItems();
}
示例13: LibraryDataView
public LibraryDataView()
{
// let the application controler know about this window so it can use it to switch library providers if it needs to.
ApplicationController.Instance.CurrentLibraryDataView = this;
currentLibraryProvider = new LibraryProviderSelector(SetCurrentLibraryProvider);
currentLibraryProvider.DataReloaded += LibraryDataReloaded;
if (libraryDataViewInstance != null)
{
throw new Exception("There should only ever be one of these, Lars.");
}
libraryDataViewInstance = this;
// set the display attributes
{
this.AnchorAll();
this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
this.ScrollArea.Padding = new BorderDouble(3, 3, 5, 3);
}
ScrollArea.HAnchor = HAnchor.ParentLeftRight;
AutoScroll = true;
topToBottomItemList = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomItemList.HAnchor = HAnchor.ParentLeftRight;
AddChild(topToBottomItemList);
AddAllItems();
providerMessageWidget = new TextWidget("")
{
PointSize = 8,
HAnchor = HAnchor.ParentRight,
VAnchor = VAnchor.ParentBottom,
TextColor = ActiveTheme.Instance.SecondaryTextColor,
Margin = new BorderDouble(6),
AutoExpandBoundsToText = true,
};
providerMessageContainer = new GuiWidget()
{
VAnchor = VAnchor.FitToChildren,
HAnchor = HAnchor.ParentLeftRight,
BackgroundColor = new RGBA_Bytes(ActiveTheme.Instance.SecondaryBackgroundColor, 220),
Visible = false,
};
providerMessageContainer.AddChild(providerMessageWidget);
this.AddChildToBackground(providerMessageContainer, -1);
}
示例14: FolderBreadCrumbWidget
public FolderBreadCrumbWidget(Action<LibraryProvider> SwitchToLibraryProvider, LibraryProvider currentLibraryProvider)
{
this.Name = "FolderBreadCrumbWidget";
this.SwitchToLibraryProvider = SwitchToLibraryProvider;
UiThread.RunOnIdle(() => SetBreadCrumbs(null, currentLibraryProvider));
navigationButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryTextColor;
navigationButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor;
navigationButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
navigationButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryTextColor;
navigationButtonFactory.disabledFillColor = navigationButtonFactory.normalFillColor;
navigationButtonFactory.Margin = new BorderDouble(10, 0);
navigationButtonFactory.borderWidth = 0;
}
示例15: 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();
}