Class AddinUserInterfaceExtensions
- Namespace
- Hymma.Solidworks.Addins.Fluent
- Assembly
- Hymma.Solidworks.Addins.Fluent.dll
Provides extension methods for creating add-in user interfaces using the fluent API.
public static class AddinUserInterfaceExtensions
- Inheritance
-
AddinUserInterfaceExtensions
- Inherited Members
Remarks
This class is the entry point for the fluent API. Use GetBuilder(AddinMaker) to start building your add-in's user interface with a chainable, readable syntax.
Methods
GetBuilder(AddinMaker)
Creates a new AddinModelBuilder to build the add-in's user interface using the fluent API pattern.
public static AddinModelBuilder GetBuilder(this AddinMaker addinMaker)
Parameters
addinMakerAddinMakerThe add-in instance to build the UI for.
Returns
- AddinModelBuilder
A new AddinModelBuilder instance for fluent configuration.
Examples
Using the fluent API to build an add-in UI:
public override AddinUserInterface GetUserInterFace()
{
var builder = this.GetBuilder();
return builder
.AddCommandTab()
.WithTitle("My Tools")
.That()
.IsVisibleIn(new[] { swDocumentTypes_e.swDocPART })
.SetCommandGroup(1)
.WithTitle("My Commands")
.WithIcon(Properties.Resources.MyIcon)
.Has()
.Commands(() => new AddinCommand[]
{
new AddinCommand("My Command", "Hint", "Tooltip",
Properties.Resources.CmdIcon,
nameof(MyCallback), nameof(MyEnabler))
})
.SaveCommandGroup()
.SaveCommandTab()
.WithIconsPath(new DirectoryInfo(iconsPath))
.Build();
}
Remarks
This is the entry point for the fluent API. Chain method calls to define command tabs, command groups, property manager pages, and other UI elements.
- See Also