Daniel's XL Toolbox NG
XLToolbox.Export.Models.PresetsRepository Class Reference

Repository for export settings, is concerned with storing and retrieving a collection of Presets. More...

Public Member Functions

void Add (Preset preset)
 
Preset Add (FileType fileType, int dpi, ColorSpace colorSpace)
 
void Remove (Preset preset)
 
Preset FindByHash (string hash)
 Retrieves a Preset by its MD5 hash. If the hash is not found in the repository, this method returns null. More...
 
Preset FindOrAdd (Preset preset)
 Looks up a preset by its guid and returns the Preset object stored in the repository. If the guid is not found, the Preset is added to the repository. More...
 

Properties

static PresetsRepository Default [get, set]
 The default (singleton) presets repository will always have at least one Preset, unless the Presets collection is replaced with an empty collection. More...
 
ObservableCollection< PresetPresets [get, set]
 Gets or sets the Presets collection. More...
 
Preset First [get]
 Gets the first preset in the repository. Will create one if necessary. More...
 

Detailed Description

Repository for export settings, is concerned with storing and retrieving a collection of Presets.

Member Function Documentation

◆ Add() [1/2]

void XLToolbox.Export.Models.PresetsRepository.Add ( Preset  preset)
inline

◆ Add() [2/2]

Preset XLToolbox.Export.Models.PresetsRepository.Add ( FileType  fileType,
int  dpi,
ColorSpace  colorSpace 
)
inline

◆ FindByHash()

Preset XLToolbox.Export.Models.PresetsRepository.FindByHash ( string  hash)
inline

Retrieves a Preset by its MD5 hash. If the hash is not found in the repository, this method returns null.

Parameters
hashMD5 hash to look up.
Returns
Corresponding Preset, or null if no Preset with this hash exists.

◆ FindOrAdd()

Preset XLToolbox.Export.Models.PresetsRepository.FindOrAdd ( Preset  preset)
inline

Looks up a preset by its guid and returns the Preset object stored in the repository. If the guid is not found, the Preset is added to the repository.

This method serves to reuse existing Presets: Given a Preset object, if a Preset object with the same guid exists in the repository, this object will be returned to that the original Preset object can be discarded.

◆ Remove()

void XLToolbox.Export.Models.PresetsRepository.Remove ( Preset  preset)
inline

Property Documentation

◆ Default

PresetsRepository XLToolbox.Export.Models.PresetsRepository.Default
staticgetset

The default (singleton) presets repository will always have at least one Preset, unless the Presets collection is replaced with an empty collection.

◆ First

Preset XLToolbox.Export.Models.PresetsRepository.First
get

Gets the first preset in the repository. Will create one if necessary.

◆ Presets

ObservableCollection<Preset> XLToolbox.Export.Models.PresetsRepository.Presets
getset

Gets or sets the Presets collection.


The documentation for this class was generated from the following file: