Create C# class with Visual Studio
- Open your project in Visual Studio
- Select your project and click on
- Add -> New Item...
- Select Visual C# Items -> Class
- Rename your class here with MyCommandWithRibbonControl
Click OK.
Create a new Ribbon button Command
To create a new command, derive your MyCommandWithoutRibbonControl class from the AbstractCommand interface.
To use these interfaces see the Add-in sample in C# with a specialized library. sample.
public class MyCommandWithoutRibbonControl : AbstractCommand
{
public override string CommandName => "MySuperCommandWithoutRibbonControl";
public override EwErrorCode execute(EwCommandContextX commandContextX)
{
AddinContainer.Get<Logger>()?.Info()
.Message("Called from command without ribbon control")
.Write();
}
public override string getDescription(out
EwErrorCode errorCode)
{
return "My description";
}
}
- Note
- mEwApplicationX: application object previously created.