Edit this page

Implement ToolBase Class

The ToolBase class is an abstract class which implements the ITool interface and has the following virtual and abstract members:

Virtual

Properties:

  • IsResetSettingsSupported: The base implementation returns true. You can override this property and return false if the tool settings shall not be reset after its commit.

Abstract

Properties:

  • IsPreviewOverlay: Returns whether the tool has a preview overlay on the main image.

  • IsDirty: Returns whether the tool has made any changes on the image.

  • AffectsLayout: Returns whether the tool is changing the image size.

Methods:

  • GetCommand(): Returns the tool’s associated command of type IImageCommand.

  • GetContext(): Returns the tool’s command context.

  • ResetSettings(): Resets the tool’ settings if the tool’s IsResetSettingsSupported property is true.

  • AttachUI(): Passes a ToolInitInfo object as a parameter whose members can be used by the tool. The method is invoked on tool’s execution.

  • DettachUI(): The method is invoked when the tool execution is canceled. For example, this occurs after the executing tool is changed.

  • GetSettingsUI(): Returns an UIElement which shall be placed as a content of the RadImageEditor’s ToolSettingsContainer.

See Also