
When i create a node and change the Textrange the length value is one short. Sample for a Node with offsets 1 till 5 ( 5 long):
Both DoTestx() report value 4.
public partial class TestNode : ActiproSoftware.SyntaxEditor.AstNodeBase {
public TestNode(ActiproSoftware.SyntaxEditor.TextRange range) : base(range) { }
public TestNode() : base() { }
public static void DoTest1() {
TestNode node = new TestNode();
node.TextRange = new ActiproSoftware.SyntaxEditor.TextRange(1, 5);
Debug.Write(node.Length);
}
public static void DoTest2() {
TestNode node = new TestNode(new ActiproSoftware.SyntaxEditor.TextRange(1, 5));
Debug.Write(node.Length);
}
public override int ContextID {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
}