Description
The Current
property of the Editor.CodeEditor
class provides access to the current code editor being used within the s&box environment. This property is static and publicly accessible, allowing developers to interact with the code editor that is currently active.
Usage
To access the current code editor, use the Editor.CodeEditor.Current
property. This will return an instance of Editor.ICodeEditor
, which can be used to perform various operations related to code editing, such as opening files or solutions.
Example
// Access the current code editor
Editor.ICodeEditor currentEditor = Editor.CodeEditor.Current;
// Use the current editor to open a file
if (currentEditor != null)
{
currentEditor.OpenFile("path/to/your/file.cs");
}