The opinions expressed in these forums do not represent those of C2, and any discussion of profit/loss
is not indicative of future performance or success.
There is a substantial risk of loss in trading. You should therefore carefully consider
whether such trading is suitable for you in light of your financial condition. You should read,
understand, and consider the Risk Disclosure Statement that is provided by your broker
before you consider trading. Most people who trade lose money.
I try to create a method in the editor, i.e. add to the end of the file a method.
But in the compile I always get an Type or namespace definition, or end-of-file expected
error.
I am not a C# expert, but maybe the editor automagically adds some decoration to the beginning (or end) of my source code that makes the code imbalanced if I add a method?
I am not a C# expert, but maybe the editor automagically adds some decoration to the beginning (or end) of my source code that makes the code imbalanced if I add a method?
Exactly. Your code is injected into a “template”, compiled and running then.
This is that template:
using System;
using System.Collections.Generic;
using System.Linq;
// ... and other namespaces here
namespace C2ExplorerServiceStack.Logic.Implementation
{
class Script : QueryRunner {
override void ExecuteUserCode()
{
------ Your code is injected here. -----
}
}
}