szabototo89 / CodeSharper

Refactoring tool, written in C# and using TDD for developing
2 stars 0 forks source link

Core: SubTextNode should extend from TextNode #24

Closed szabototo89 closed 10 years ago

szabototo89 commented 10 years ago

SubTextNode should be a logical subnode to TextNode.

public class SubTextNode : TextNode {
  public SubTextNode(TextRange range, TextNode parent) { /* ... */ }
  // Text is a reference to a substring of Parent.Text
  public override string Text {
     get { return Parent.Text.SubString(range.Start, range.End); }
     set { Parent.Text.SubString(range.Start, range.End) = value; }
  }
}
szabototo89 commented 10 years ago

It is refactored to TextDocument class.