Class Path
Represents a relative or absolute path, stored in a settings file.
public class Path : AbsoluteToRelativePathBase, INotifyPropertyChangedEx, INotifyPropertyChanged, IPath, IHasKey
- Inheritance
-
PropertyChangedBasePath
- Implements
-
INotifyPropertyChangedEx
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Constructors
Path(string, ITranslation, string, SettingsBase, string)
Initializes a new instance of the Path class.
public Path(string key, ITranslation description, string settingsKey, SettingsBase settings, string relativeBasePath = null)
Parameters
keystringUnique key.
descriptionITranslationDescription for the path.
settingsKeystringKey of the setting to store the path. Usually use the OptionsSettingsProvider as provider for the setting.
settingsSettingsBaseSettingsBase with the
settingsKey.relativeBasePathstringThe relative base path or null if the Path should be absolute.
Remarks
The setting must be user-scoped.
Exceptions
- ArgumentNullException
Thrown when any parameter (except
relativeBasePath) is null.- ArgumentException
Thrown if the
settingsKeyin thesettingsis not a string.- KeyNotFoundException
Thrown if the
settingsKeyis not found.
Properties
BasePath
Gets the path base for the RelativePath. Empty if no relative path is used.
protected override string BasePath { get; }
Property Value
Description
Gets the translatable description.
public override ITranslation Description { get; }
Property Value
- ITranslation
Key
Gets the unique key.
public override string Key { get; }
Property Value
RelativePath
Gets or sets the relative path or the absolute path if BasePath is null.
protected override string RelativePath { get; set; }
Property Value
Methods
Save()
Saves the settings.
public override void Save()