Skip to content

AttributeUsage

Nils Kopal edited this page Feb 15, 2022 · 1 revision

Table of Contents

The CrypTool Attributes

CrypTool has specific attributes to support the plugin developer with GUI development. Some are optional, some essential and some attributes are only used for editor plugins:

AuthorAttribute

  1. AuthorAttribute
Please do not enter dummy URLs or a faked email address. Skip this attribute completely or enter 'null' value in fields you don't want to give information.

Useability: Optional

Parameters:

  1. string author: the author's name
  2. string email: the author's e-mail address
  3. string institute: the author's institute
  4. string url: an url to the author's web site
Example:

ComponentCategoryAttribute

  1. ComponentCategoryAttribute
Used to set the category for the plugin.

Useability: Essential

Parameters:

  1. ComponentCategory category: set the plugin's category
Example:

ContextMenuAttribute

  1. ContextMenuAttribute
Do not use this attribute anymore.

Useability: Obsolete


DontSaveAttribute

  1. DontSaveAttribute
Used as flag to mark a plugin's property so that it would not be saved in the workspace file.

Useability: Optional

Parameters: none

Example:


EditorInfoAttribute

  1. EditorInfoAttribute
This attribute should be only used by editor plugins, like for example the workspace manager.

Used to provide information about the editor's abilities.

Useability: Insignificant

Parameters:

  1. string defaultExtension: represents the editor's default file extension
  2. bool showAsNewButton: adds the editor to the "new"-button; default: true
  3. bool showLogPanel: show the log panel; default: true
  4. bool showSettingsPanel: show the settings panel; default: false
  5. bool showComponentPanel: show the component panel; default: true
  6. bool singleton: only one editor instance is allowed, if true; default: false
  7. bool canEdit: activates the buttons "Add Image" and "Add Text" at the category "Edit" of the ribbon bar; default: false
Example:

LocalizationAttribute

  1. LocalizationAttribute
Used to provide the localization ressource class for XAML with localized strings for internationalization using the mechanism described here. This should not be confused with the ressource property of the PluginInfoAttribute.

Useability: Optional

Parameters:

  1. string resourceClassPath: the path to the resource class (i.e. namespace.classname)
Example:

PluginInfoAttribute

  1. PluginInfoAttribute
Used to describe different plugin properties. If not provided your plugin can't be used in CrypTool!

Useability: Essential

Parameters:

  1. string resourceFile: the resource file - optional
  2. string caption: general name of the method
  3. string toolTip: the tooltip's text
  4. string descriptionUrl: URI to description, if provided
  5. params string[] icons: URIs to the plugin's icons


Example:


PropertyInfoAttribute

  1. PropertyInfoAttribute
Used to declare a plugin's properties as a connector and describe it's metainformations.

Useability: Essential

Parameters:

  • mandatory
    1. Direction direction: direction of the data
    2. string caption: the property's name
    3. string toolTip: description of the property
  • optional
    • bool mandatory: property is mandatory if set to true
Example:

PropertySaveOrderAttribute

  1. PropertySaveOrderAttribute
Do not use this attribute anymore.

Useability: Obsolete


RibbonBarAttribute

  1. RibbonBarAttribute
Do not use this attribute anymore.

Useability: Obsolete


SettingsFormatAttribute

  1. SettingsFormatAttribute
Used to format a plugin's setting property.

Useability: Optional

Parameters:

  • mandatory
    1. int indent: moves the property caption to the choosen indent
    2. string fontWeight: set the font weight
    3. string fontStyle: set the font style
  • optional
    • string foreGroundColor: set the foreground color
    • string backGroundColor: set the background color
    • Orientation orientation: set the orientation
    • string widthCol1: Column width of column one. Is only used when no group is selected. Value samples: Auto, Auto or 1*, 2*. Last sample indicates that column 1 wants to be given twice as much of the available space as the row marked with 1*.
    • string widthCol2: Column width of column two. Is only used when no group is selected.
    • string verticalGroup: group some properties
Example:

SettingsTabAttribute

  1. SettingsTabAttribute
Used to mark a class that offers a setting tab.

Useability: Insignificant

Parameters:

  1. string caption: the settings' tabs name
  2. string address: the position in the settings tree
  3. double priority: A double that represents the settings tab priority. Tabs with higher priority will be shown first. default: 0.5
Example:

TabColorAttribute

  1. TabColorAttribute
Used to set the brush color for drawing the tabs background.

Useability: Insignificant

Parameters:

  1. string brush: the brush color
Example:

TaskPaneAttribute

  1. TaskPaneAttribute
Used to declare a plugin's property (in it's settings class) as a setting item.

Useability: Essential

Parameters:

  • mandatory
    1. string caption: parameter's name
    2. string toolTip: parameter's tooltip
    3. string groupName: parameter's group
    4. int order: A number to change the order of the parameters in the same group. Parameters with a lower number are displayed first. Parameters with same number are alphabetically arranged.
    5. bool changeableWhileExecuting: parameter is during the execution changable, if set to true
    6. ControlType controlType: parameter's control type
  • optional
    • params string[] controlValues: control values used to display in ComboBox
    • ValidationType validationType: possibility to validate the input's type
    • int integerMinValue: minimum value for instance for ControlType.NumericUpDown
    • int integerMaxValue: maximum value for instance for ControlType.NumericUpDown
    • double doubleMinValue: minimum value
    • double doubleMaxValue: maximum value
    • string regularExpression: regex validation for ControlType.TextBox

Example:


All supported attributes can be found in the project browser of your IDE at "CrypPluginBase/Attributes/xxx.cs".