Interface IGuiTool
Represents the declaration of a tool with a GUI.
Namespace: DevToys.Api
Assembly: DevToys.Api.dll
Syntax
public interface IGuiTool
Remarks
The project containing the ResourceManager with all the strings for the tool should contain an implementation of IResourceAssemblyIdentifier as shown in the example.
[Export(typeof(IGuiTool))]
[Name("Base64 Encoder / Decoder")]
[ToolDisplayInformation(
IconFontName = "FluentSystemIcons",
IconGlyph = "\u0108",
GroupName = "Encoders / Decoders", //
ResourceManagerAssemblyIdentifier = nameof(MyResourceManagerAssemblyIdentifier), //
ResourceManagerBaseName = "MyProject.Strings",
ShortDisplayTitleResourceName = nameof(MyProject.Strings.ShortDisplayTitle),
LongDisplayTitleResourceName = nameof(MyProject.Strings.LongDisplayTitle), // Optional
DescriptionResourceName = nameof(MyProject.Strings.Description), // Optional
AccessibleNameResourceName = nameof(MyProject.Strings.AccessibleName), // Optional
SearchKeywordsResourceName = nameof(MyProject.Strings.SearchKeywords))] // Optional
[TargetPlatform(Platform.Windows)] // Optional
[TargetPlatform(Platform.WASM)] // Optional
[Order(Before = "Base64 Image Decoder")] // Optional
[MenuPlacement(MenuPlacement.Footer)] // Optional
[NotSearchable] // Optional
[NotFavorable] // Optional
[NoCompactOverlaySupport] // Optional
internal sealed class Base64GuiTool : IGuiTool
{
}
[Export(typeof(IResourceManagerAssemblyIdentifier))]
[Name(nameof(MyResourceManagerAssemblyIdentifier))]
public sealed class MyResourceManagerAssemblyIdentifier : IResourceManagerAssemblyIdentifier
{
}
Properties
View
Gets the view for the tool.
Declaration
UIToolView View { get; }
Property Value
Type | Description |
---|---|
UIToolView |
Methods
OnDataReceived(string, object?)
Invoked when the app detected a data compatible with the tool and that the user navigates to this tool in question.
The expected behavior of this method is to pass the parsedData
to the IUIElement
that fits the given data.
Declaration
void OnDataReceived(string dataTypeName, object? parsedData)
Parameters
Type | Name | Description |
---|---|---|
string | dataTypeName | The data type name, as defined by AcceptedDataTypeNameAttribute. |
object | parsedData | The data returned by the corresponding IDataTypeDetector. |