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
  AbstractSettingsPage
    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.2343.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
Methods
  NameDescription
Public methodAfterCancel (Inherited from AbstractSettingsPage.)
Public methodAfterSave (Inherited from AbstractSettingsPage.)
Public methodCancel (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 AbstractSettingsPage.Dispose.)
Protected methodDispose(Boolean)
Override this method to perform additional clean-up tasks when the object is destroyed.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Finalizer calls Dispose(Boolean) with false
(Overrides ObjectFinalize.)
Public methodGetControl
Called by the framework to obtain the user interface control.
(Overrides AbstractSettingsPage.GetControl.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnActivate (Inherited from AbstractSettingsPage.)
Public methodOnDeactivate (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 AbstractSettingsPage.Refresh.)
Public methodResetToDefaults
Called to reset settings to their default values. Should update the user interface accordingly.
(Overrides AbstractSettingsPage.ResetToDefaults.)
Public methodSave
Called when settings should be saved. The implementation is responsible for persisting the settings.
(Overrides AbstractSettingsPage.Save.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidateInput (Inherited from AbstractSettingsPage.)
Top
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 (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 (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
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