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:
- insignificant:
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:
- string author: the author's name
- string email: the author's e-mail address
- string institute: the author's institute
- string url: an url to the author's web site
Example:
[Author("Name Surname", "name.surname", "Institute", "URL")]
ComponentCategoryAttribute
Used to set the category for the plugin.
Useability: Essential
Parameters:
- ComponentCategory category: set the plugin's category
Example:
[ComponentCategory(ComponentCategory.ToolsMisc)]
ContextMenuAttribute
Do not use this attribute anymore.
Useability: Obsolete
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:
[TaskPane( ... )] [DontSave] public int OpenCLDevice { ... }
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:
- string defaultExtension: represents the editor's default file extension
- bool showAsNewButton: adds the editor to the "new"-button; default: true
- bool showLogPanel: show the log panel; default: true
- bool showSettingsPanel: show the settings panel; default: false
- bool showComponentPanel: show the component panel; default: true
- bool singleton: only one editor instance is allowed, if true; default: false
- bool canEdit: activates the buttons "Add Image" and "Add Text" at the category "Edit" of the ribbon bar; default: false
Example:
[TabColor("LightSlateGray")] [EditorInfo("cwm", true, true, false, true, false, true)] [Author( ... )] [PluginInfo( ... )] public class WorkspaceManagerClass : IEditor { ... }
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:
- string resourceClassPath: the path to the resource class (i.e. namespace.classname)
Example:
[Localization("Cryptool.Plugins.MD5.Properties.Resources")] public partial class AddedLengthPresentation : UserControl { ... }
PluginInfoAttribute
Used to describe different plugin properties. If not provided your plugin can't be used in CrypTool!
Useability: Essential
Parameters:
- string resourceFile: the resource file - optional
- string caption: general name of the method
- string toolTip: the tooltip's text
- string descriptionUrl: URI to description, if provided
- params string[] icons: URIs to the plugin's icons
Example:
[PluginInfo("Cryptool.Caesar.Properties.Resources", "Caesar", "Classic alphabet shift substitution cipher", "Caesar/DetailedDescription/doc.xml", new[] { "Caesar/Images/Caesar.png", "Caesar/Images/encrypt.png", "Caesar/Images/decrypt.png" } )]
PropertyInfoAttribute
Used to declare a plugin's properties as a connector and describe it's metainformations.
Useability: Essential
Parameters:
- mandatory
- Direction direction: direction of the data
- string caption: the property's name
- string toolTip: description of the property
- optional
- bool mandatory: property is mandatory if set to true
Example:
[PropertyInfo(Direction.InputData, "Text input", "Input a string to be processed by the Caesar cipher", true)]
PropertySaveOrderAttribute
Do not use this attribute anymore.
Useability: Obsolete
RibbonBarAttribute
Do not use this attribute anymore.
Useability: Obsolete
SettingsFormatAttribute
Used to format a plugin's setting property.
Useability: Optional
Parameters:
- mandatory
- int indent: moves the property caption to the choosen indent
- string fontWeight: set the font weight
- 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:
[SettingsFormat(1, "Normal", "Normal")] [TaskPane( ... )] public bool AnalysisUseRotorI { ... } [SettingsFormat(0, "Normal", "Normal", "Black", "White", Orientation.Horizontal, "Auto", "*", "Acht")] [TaskPane( ... )] public int PlugBoardV { ... }
SettingsTabAttribute
Used to mark a class that offers a setting tab.
Useability: Insignificant
Parameters:
- string caption: the settings' tabs name
- string address: the position in the settings tree
- double priority: A double that represents the settings tab priority. Tabs with higher priority will be shown first. default: 0.5
Example:
[SettingsTab("KeySearcher", "/PluginSettings/")] public partial class KeysearcherSettingsTab : UserControl { ... }
TabColorAttribute
Used to set the brush color for drawing the tabs background.
Useability: Insignificant
Parameters:
- string brush: the brush color
Example:
[TabColor("LightSlateGray")] [EditorInfo("cwm", true, true, false, true, false, true)] [Author( ... )] [PluginInfo( ... )] public class WorkspaceManagerClass : IEditor { ... }
TaskPaneAttribute
Used to declare a plugin's property (in it's settings class) as a setting item.
Useability: Essential
Parameters:
- mandatory
- string caption: parameter's name
- string toolTip: parameter's tooltip
- string groupName: parameter's group
- 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.
- bool changeableWhileExecuting: parameter is during the execution changable, if set to true
- 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:
[TaskPane( "Max. plugs searched", "Select how many plugs should ...", "Analysis options", 9, false, ControlType.NumericUpDown, ValidationType.RangeInteger, 1, 26)] public int MaxSearchedPlugs { ... } [TaskPane("Plug search method", "Which method should be ...", "Analysis options", 9, false, ControlType.ComboBox, new string[] { "Index of coincidence", "log2-bigram", "log2-trigram" })] public int PlugSearchMethod { ... } [TaskPane( "Key (Initial rotor setting)", "Please provide the initial rotor setting ...", null, 1, false, ControlType.TextBox, ValidationType.RegEx, "^[A-Za-z]{3,4}$")] public string Key { ... } [TaskPane( "Presentation Speed", "Change the pace of the presentation", "Presentation", 71, true, ControlType.Slider, 2, 25)] public int PresentationSpeed { ... }
All supported attributes can be found in the project browser of your IDE at "CrypPluginBase/Attributes/xxx.cs".