Class AbstractSettingsPage
Abstract base representing an page that can configure settings within an application.
Inheritance
Inherited Members
Namespace: Sdl.Core.Settings
Assembly: Sdl.Core.Settings.dll
Syntax
public abstract class AbstractSettingsPage : ISettingsPage, IDisposable
Constructors
AbstractSettingsPage()
Declaration
protected AbstractSettingsPage()
Properties
DataSource
The object which the settings page will manipulate the values upon. This is typically an ISettingsBundle.
Declaration
public object DataSource { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
HasDefaultSettings
Called to determine whether the settings page supports the ResetToDefaults() method.
Declaration
public virtual bool HasDefaultSettings { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Determines whether a 'Reset To Default' button should be displayed/enabled in the host application.
Methods
AfterCancel()
Called after all settings pages shown on the settings dialog have been canceled.
Declaration
public virtual void AfterCancel()
AfterSave()
Called after all settings pages shown on the settings dialog have been saved.
Declaration
public virtual void AfterSave()
Cancel()
Called when the settings dialog is canceled.
Declaration
public virtual void Cancel()
Dispose()
Derived classes must implement Dispose() to ensure that controls created by GetControl() are disposed of.
Declaration
public abstract void Dispose()
GetControl()
Called by the framework to retrieve the control that displays the user interface for the settings page.
Declaration
public abstract object GetControl()
Returns
Type | Description |
---|---|
System.Object | The control that displays the user interface for the settings page. The implementor is also responsible for disposing of this control in their implementation of Dispose() |
Remarks
The derived class must initialise and return the control.
OnActivate()
Called when this settings page is activated.
Declaration
public virtual void OnActivate()
OnDeactivate()
Called when this settings page is deactivated.
Declaration
public virtual void OnDeactivate()
Refresh()
Called to refresh the page to the current DataSource if it has been changed externally. This can happen when a user imports external settings that affect the data source.
Declaration
public virtual void Refresh()
ResetToDefaults()
Called to reset settings to default values. The implementation is responsible for resetting the settings and updating the user interface accordingly.
Declaration
public virtual void ResetToDefaults()
Remarks
This method should not save the settings yet. This should be done in Save().
This method will not be called if HasDefaultSettings returns false
.
Save()
Called when settings should be saved. The implementation is responsible for persisting the settings.
Declaration
public virtual void Save()
Remarks
This method is called once, after ValidateInput() has been called.
ValidateInput()
Returns true if the input on this settings page is valid.
Declaration
public virtual bool ValidateInput()
Returns
Type | Description |
---|---|
System.Boolean | True if the input on this settings page is valid. |
Remarks
This method is called when navigating away from a page and before Save() is called.