@@ -30,21 +30,29 @@ namespace ICSharpCode.CodeCoverage
3030 public class CodeCoverageMethodElement
3131 {
3232 XElement element ;
33- CodeCoverageResults parent ;
33+ CodeCoverageResults results ;
3434
35+ /// <summary>Enables CodeCoverage.Test to compile</summary>
36+ /// <param name="element">XMLElement</param>
3537 public CodeCoverageMethodElement ( XElement element )
3638 : this ( element , null ) { }
37- public CodeCoverageMethodElement ( XElement element , CodeCoverageResults parent )
39+
40+ /// <summary>Create Method Element</summary>
41+ /// <param name="element">XMLElement</param>
42+ /// <param name="results">has .GetFileName(FileID)</param>
43+ public CodeCoverageMethodElement ( XElement element , CodeCoverageResults results )
3844 {
39- this . parent = parent ;
45+ this . results = results ;
4046 this . element = element ;
4147 this . SequencePoints = new List < CodeCoverageSequencePoint > ( ) ;
42- this . BranchPoints = new List < CodeCoverageBranchPoint > ( ) ;
4348 Init ( ) ;
4449 }
50+
51+ // Primary TextSource cache
4552 private static string cacheFileName = String . Empty ;
4653 private static CodeCoverageStringTextSource cacheDocument = null ;
4754
55+ // Secondary TextSource cache
4856 private static string cache2FileName = String . Empty ;
4957 private static CodeCoverageStringTextSource cache2Document = null ;
5058
@@ -59,7 +67,6 @@ public CodeCoverageMethodElement(XElement element, CodeCoverageResults parent)
5967 public bool IsConstructor { get ; private set ; }
6068 public bool IsStatic { get ; private set ; }
6169 public List < CodeCoverageSequencePoint > SequencePoints { get ; private set ; }
62- public List < CodeCoverageBranchPoint > BranchPoints { get ; private set ; }
6370 public CodeCoverageSequencePoint BodyStartSP { get ; private set ; }
6471 public CodeCoverageSequencePoint BodyFinalSP { get ; private set ; }
6572
@@ -80,8 +87,8 @@ void Init()
8087 this . FileID = GetFileRef ( ) ;
8188 this . FileName = String . Empty ;
8289 if ( ! String . IsNullOrEmpty ( this . FileID ) ) {
83- if ( parent != null ) {
84- this . FileName = parent . GetFileName ( this . FileID ) ;
90+ if ( results != null ) {
91+ this . FileName = results . GetFileName ( this . FileID ) ;
8592 if ( cacheFileName != this . FileName ) {
8693 cacheFileName = this . FileName ;
8794 cacheDocument = GetSource ( cacheFileName ) ;
@@ -165,7 +172,7 @@ void GetSequencePoints() {
165172 // SequencePoint from another method/file
166173 // ie: ccrewriten CodeContractClass/CodeContractClassFor
167174 // [or dependency-injected or fody-weaved???]
168- sp . Document = parent . GetFileName ( sp . FileID ) ;
175+ sp . Document = results . GetFileName ( sp . FileID ) ;
169176 }
170177 sp . BranchCoverage = ( sp . BranchExitsCount == sp . BranchExitsVisit ) ;
171178 sp . Content = String . Empty ;
0 commit comments