Click or drag to resize
AbstractFileTypeSettingsPageSettingsControlType, SettingsType Class
Convenient implementation class for settings pages that handles the initialization of settings and controls, and provides a default implementation of the file type specific settings page interface.
Inheritance Hierarchy
SystemObject
  Sdl.Core.SettingsAbstractSettingsPage
    Sdl.FileTypeSupport.Framework.Core.SettingsAbstractFileTypeSettingsPageSettingsControlType, SettingsType

Namespace: Sdl.FileTypeSupport.Framework.Core.Settings
Assembly: Sdl.FileTypeSupport.Framework.Core.Settings (in Sdl.FileTypeSupport.Framework.Core.Settings.dll) Version: 1.0.0.0 (1.0.2551.2)
Syntax
public abstract class AbstractFileTypeSettingsPage<SettingsControlType, SettingsType> : AbstractSettingsPage, 
	IFileTypeConfigurationAware
where SettingsControlType : new()
where SettingsType : new(), FileTypeSettingsBase

Type Parameters

SettingsControlType
Control class that will be used to edit the settings; should be derived from Control, and have a default constructor. The control should implement IFileTypeSettingsAware, and use data binding to interact with the settings.
SettingsType
Settings data container class; should implement FileTypeSettingsBase and raise property change events when data is changed. Must have a default constructor. The settings class should correspond to the settings displayed by the control for the ResetToDefaults function to work as expected without manual tweaking. If the settings class contains settings used by other pages, you must override the ResetToDefaults method to ensure that only the settings for this page are reset.

The AbstractFileTypeSettingsPageSettingsControlType, SettingsType type exposes the following members.

Constructors
Properties
  NameDescription
Protected propertyControl
This property provides derived classes direct access to the control, which may or may not yet have been created.
Public propertyDataSource
The object which the settings page will manipulate the values upon. This is typically an ISettingsBundle.
(Inherited from AbstractSettingsPage.)
Public propertyFileTypeConfigurationId
Id of the file type that is being configured. This id can be used (as a key) to retrieve the settings group representing the file type settings from a settings bundle.
Public propertyHasDefaultSettings
Called to determine whether the settings page supports the ResetToDefaults method.
(Inherited from AbstractSettingsPage.)
Public propertySettings
The settings are created and initialized the first time this property is accessed.
Public propertySettingsBundle
The SettingsBundle which contains setting information for the page
Public propertySubContentFileTypeConfigurationIds
List of FileTypeConfigurationIds of all subcontent processing file types
Top
Methods
  NameDescription
Public methodAfterCancel
Called after all settings pages shown on the settings dialog have been canceled.
(Inherited from AbstractSettingsPage.)
Public methodAfterSave
Called after all settings pages shown on the settings dialog have been saved.
(Inherited from AbstractSettingsPage.)
Public methodCancel
Called when the settings dialog is canceled.
(Inherited from AbstractSettingsPage.)
Protected methodCreateAndInitializeControl
Called from GetControl when the control implementation is needed for the first time. The implementation should create and initialize the control.
Protected methodCreateAndInitializeSettings
Called to create the settings the first time they are needed, typically during the first call to GetControl.
Public methodDispose
Standard implementation of the Dispose method; calls Dispose(Boolean) with true and suppresses finalization.
(Overrides AbstractSettingsPageDispose.)
Protected methodDispose(Boolean)
Override this method to perform additional clean-up tasks when the object is destroyed.
Protected methodFinalize
Finalizer calls Dispose(Boolean) with false
(Overrides ObjectFinalize.)
Public methodGetControl
Called by the framework to obtain the user interface control.
(Overrides AbstractSettingsPageGetControl.)
Public methodOnActivate
Called when this settings page is activated.
(Inherited from AbstractSettingsPage.)
Public methodOnDeactivate
Called when this settings page is deactivated.
(Inherited from AbstractSettingsPage.)
Public methodRefresh
Called to re-populate the settings when the underlying data source has been changed externally. This can happen when settings are imported, for example.
(Overrides AbstractSettingsPageRefresh.)
Public methodResetToDefaults
Called to reset settings to their default values. Should update the user interface accordingly.
(Overrides AbstractSettingsPageResetToDefaults.)
Public methodSave
Called when settings should be saved. The implementation is responsible for persisting the settings.
(Overrides AbstractSettingsPageSave.)
Public methodValidateInput
Returns true if the input on this settings page is valid.
(Inherited from AbstractSettingsPage.)
Top
Remarks

Settings pages do not need to be derived from this class. However, if they follow standard patterns, deriving from this class can result in a simpler implementation.

Examples

To use this class in order to implement a file type settings page, take the following steps:

  • Create a settings class that implements FileTypeSettingsBase. Make sure that your property setters are raising the PropertyChanged event when values change. Implement the ResetToDefaults method by calling the property setters (rather than updating the fields directly). Implement settings reading and writing functionality using the settings bundle.
  • Create a settings control for the settings page, and implement IFileTypeSettingsAware for your settings class. In the property setter for Settings, assign the value to LayoutRoot.DataContext. Implement the user interface by using two-way data binding to access and update the settings.
  • Create a settings page class derived from this class and mark it with the FileTypeSettingsPageAttribute.

The default implementation of the settings page and the data binding will take care of everything else. Unless you require special processing for anything, there should be no need to override any of the methods and properties in this base class.

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments