Execute C# Code

Sub-action for writing advanced custom actions with C# code
Learn more about custom code actions at Guide > C# Code Actions
Explore all available C# methods at API References > C# Methods

Views

Compiling Log

Shows some general information based on what buttons you've pressed, this will show any compiler errors, and general information when trying to find references

References

List the references required for compiling your code.

You can Right-Click within the pane if you need to add specific references

Configuration

Configuration options available under the Settings tab are outlined below:

Name
Text

Optionally set a descriptive name for your C# sub-action.

Name is required if you would like to execute custom methods with the Execute C# Method sub-action.
Description
Text

Optionally set a longer description detailing what your C# sub-action does.

Keep Instance Active
Toggle

By ticking this option, your code will be kept alive for the lifetime of the Streamer.bot application.

This will allow you to preserve data between calls to this sub-action.

As of Streamer.bot v0.2.3, this option has been removed and is enabled by default.
Precompile on Application Start
Toggle

By ticking this, your code will be automatically compiled when you start Streamer.bot so it is ready to go, instead of the first time the sub-action is executed.

Delayed Start
Toggle

When Precompile on Application Start is enabled, delay compilation until later in the startup routine.

This is useful if you are implementing UI within your C# sub-action.

Save Result to Variable
Toggle

Save the bool result of the Execute() method

Returning false without this option enabled will simply stop execution of the entire action. Enabling this option allows you to collect the result and also continue execution regardless of the return value.
Variable Name
Text

When Save Result to Variable is enabled, enter the name for the resulting variable here.

Actions

Format Document
Button

Automatically format your code with proper indentation

Find Refs
Button

Attempt to automatically find some common references based on your using directives.

Compile
Button

Test the compilation of your code and check for errors.

This will also remove any references that are currently unused. If your code is stil in-progress, it could end up removing a reference that is actually needed.
Save and Compile
Button

This will save your changes, and pre-compile the code so it's ready to go the first time the action is hit

Ok
Button

Save your changes

Cancel
Button

Discard your changes