Hello Actipro,
I am looking to customize the Syntax editor component for C# scripting but am not seeing how to customize the outlining behavior. Right now, using the default CSharpOutlining that comes with the Syntax editor, it provides outlining for using statements, class definitions (and interfaces, etc.), and method definitions within those classes. However, we are hoping to have outlining behavior more like in visual studio. For the code sample below, Visual Studio outlines the 'if' statement, the 'for' loop, and the property assignment for 'MyObj'. Additionally, because our editor will be used for scripting, we would like to enable outlining of methods that are not defined within a class. (If images would help, please let me know, I am just unsure how to upload them to this forum).
namespace Scratch
{
public class MyObj
{
public int Number;
public string Str;
}
public class App
{
static void Main(string[] args)
{
if (true) // Collapse here in VS
{
for (int i = 0; i < 10; i++) // Collapse here in VS
{
var x = new MyObj
{
Number = 5,
Str = "Hello"
};
}
}
}
}
}
I would like to customize the default CSharpOutliner that comes with the syntax editor to outline these additional categories ("if", "for", object creation) in addition to enabling outlining for code outside of classes. I have looked into the CSharpOutliner and the CSharpOutliningSource and their accompanying documentation but am not seeing how to customize this. Any help is much appreciated. Thanks!
- William