DevToys’ Smart Detection system automatically routes clipboard or file data to appropriate tools. Two attributes drive this mechanism:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DevToys-app/DevToys/llms.txt
Use this file to discover all available pages before exploring further.
DataTypeNameAttribute declares what kind of data an IDataTypeDetector can recognise, and AcceptedDataTypeNameAttribute declares what named data types an IGuiTool is willing to receive. When a detector produces a match, DevToys highlights every tool whose accepted types include that detector’s declared name.
DataTypeNameAttribute
Namespace:DevToys.ApiTarget:
AttributeTargets.ClassAllowMultiple:
false
IDataTypeDetector implementation to declare the name of the data type it detects.
Constructor
The unique name for the data type this detector produces. All tools that want to receive this data type must reference this exact string in their
[AcceptedDataTypeName] attributes. Must be non-empty.An optional parent data type name. When set, this detector’s type is considered a specialisation of
baseName. DevToys uses this to chain detection: if baseName’s detector already confirmed the data, this detector only needs to check the specialisation. For example, a "jsonArray" detector could set baseName = "json" to indicate it only runs after JSON detection succeeds.Properties
| Property | Type | Description |
|---|---|---|
DataTypeName | string | The declared data type name (from constructor name). |
DataTypeBaseName | string? | The optional parent type name (from constructor baseName). |
AcceptedDataTypeNameAttribute
Namespace:DevToys.ApiTarget:
AttributeTargets.ClassAllowMultiple:
true
IGuiTool class to declare which detected data types the tool can accept. DevToys will recommend the tool and call IGuiTool.OnDataReceived when Smart Detection finds a matching type.
Constructor
The name of the data type this tool accepts. Must match the
DataTypeName declared by an IDataTypeDetector (or one of the predefined names in PredefinedCommonDataTypeNames). Must be non-empty.Properties
| Property | Type | Description |
|---|---|---|
DataTypeName | string | The accepted data type name (from constructor name). |
Predefined Data Type Names
PredefinedCommonDataTypeNames (namespace DevToys.Api) provides constants for the data types built into DevToys:
| Constant | Value | Description |
|---|---|---|
PredefinedCommonDataTypeNames.Text | "text" | Plain text |
PredefinedCommonDataTypeNames.Json | "json" | JSON document |
PredefinedCommonDataTypeNames.JsonArray | "jsonArray" | JSON array (child of "json") |
PredefinedCommonDataTypeNames.Xml | "xml" | XML document |
PredefinedCommonDataTypeNames.Xsd | "xsd" | XSD schema |
PredefinedCommonDataTypeNames.Base64Text | "base64Text" | Base64-encoded text |
PredefinedCommonDataTypeNames.Base64Image | "base64Image" | Base64-encoded image |
PredefinedCommonDataTypeNames.Image | "image" | In-memory image |
PredefinedCommonDataTypeNames.ImageFile | "imageFile" | Image file path |
PredefinedCommonDataTypeNames.File | "file" | Single file |
PredefinedCommonDataTypeNames.Files | "files" | Multiple files |
PredefinedCommonDataTypeNames.GZip | "gzip" | GZip-compressed data |
PredefinedCommonDataTypeNames.Date | "date" | Date/time string |
Example: Detector and Tool Wired Together
The following example defines a detector that recognises CSV content, then a tool that accepts CSV and receives it via Smart Detection.AllowMultiple = true on AcceptedDataTypeNameAttribute means a single tool can declare multiple accepted types. Add one [AcceptedDataTypeName(...)] attribute per type.