Skip to content

Commit

Permalink
If assembly could not be found, search in datafile-directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
alpinechough authored and vargaz committed Jan 16, 2011
1 parent 89fa165 commit 3b711c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
@@ -1,6 +1,7 @@
2011-01-15 Andreas Windischer

* gui/gtk/CoverageView.cs: Expand on double click fix.
* CoverageModel.cs: If assembly could not be found, search in datafile-directory.

2011-01-12 Andreas Windischer

Expand Down
9 changes: 9 additions & 0 deletions CoverageModel.cs
Expand Up @@ -16,6 +16,7 @@ namespace MonoCov

public class CoverageModel : CoverageItem {

private string dataFileName;
private Hashtable namespaces;
private Hashtable classes;
private Hashtable sources;
Expand All @@ -32,6 +33,7 @@ public class CoverageModel : CoverageItem {

public CoverageModel ()
{
dataFileName = string.Empty;
namespaces = new Hashtable ();
classes = new Hashtable ();
sources = new Hashtable ();
Expand Down Expand Up @@ -94,6 +96,12 @@ private void LoadAssemblies (XmlDocument dom)
string filename = n.Attributes ["filename"].Value;
MonoSymbolFile symbolFile;

if (!File.Exists (filename)) {
string newFilename = Path.Combine(Path.GetDirectoryName (dataFileName), Path.GetFileName (filename));
if (File.Exists (newFilename))
filename = newFilename;
}

#if USE_REFLECTION
Assembly assembly = Assembly.Load (assemblyName);

Expand Down Expand Up @@ -190,6 +198,7 @@ private void LoadFilters (XmlDocument dom)

public void ReadFromFile (string fileName)
{
dataFileName = fileName;
namespaces = new Hashtable ();
classes = new Hashtable ();

Expand Down

0 comments on commit 3b711c4

Please sign in to comment.