Constructor CadRibbonButton
CadRibbonButton(string, string)
Makes a button that starts a command: a command running is cancelled first, as AutoCAD's ^C^C is.
public CadRibbonButton(string text, string command)
Parameters
textstringThe text of the button.
commandstringThe command's name: "NUMCIRCLES", "_NUMCIRCLES" and ".NUMCIRCLES" start the same command.
Exceptions
- ArgumentNullException
Thrown when the text or the command is null.
- ArgumentException
Thrown when the command is empty.
CadRibbonButton(string, Action<CadPluginContext>)
Makes a button that runs a callback at once, on the window's thread.
public CadRibbonButton(string text, Action<CadPluginContext> run)
Parameters
textstringThe text of the button.
runAction<CadPluginContext>The callback. One that throws is logged as a Warn and its message written on the command line with the plugin's name.
Exceptions
- ArgumentNullException
Thrown when the text or the callback is null.