Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: icsharpcode/SharpDevelop
...
head fork: icsharpcode/SharpDevelop
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
8 src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.cs
@@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Reflection;
using ICSharpCode.CodeQuality.Engine.Dom;
using ICSharpCode.Reports.Core;
@@ -28,8 +29,11 @@ public DependencyReport(List<string> fileNames):base(fileNames)
public IReportCreator Run(ReadOnlyCollection<AssemblyNode> list)
{
- var reportFileName = MakeReportFileName(overviewReport);
- var model = ReportEngine.LoadReportModel(reportFileName);
+// var reportFileName = MakeReportFileName(overviewReport);
+//
+ System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();
+ System.IO.Stream stream = asm.GetManifestResourceStream("ICSharpCode.CodeQuality.Reporting.DependencyReport.srd");
+ var model = ReportEngine.LoadReportModel(stream);
ReportSettings = model.ReportSettings;
var newList = MakeList (list);
View
12 src/AddIns/Analysis/CodeQuality/Reporting/OverviewReport.cs
@@ -9,7 +9,9 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.IO;
using System.Linq;
+using System.Reflection;
using ICSharpCode.CodeQuality.Engine.Dom;
using ICSharpCode.NRefactory.Utils;
@@ -30,9 +32,10 @@ public OverviewReport(List<string> fileNames):base(fileNames)
public IReportCreator Run(ReadOnlyCollection<AssemblyNode> list)
{
-
- var reportFileName = MakeReportFileName(overviewReport);
- var model = ReportEngine.LoadReportModel(reportFileName);
+ System.Reflection.Assembly asm = Assembly.GetExecutingAssembly();
+ System.IO.Stream stream = asm.GetManifestResourceStream("ICSharpCode.CodeQuality.Reporting.Overviewreport.srd");
+ var model = ReportEngine.LoadReportModel(stream);
+
ReportSettings = model.ReportSettings;
var r = from c in list
@@ -45,7 +48,8 @@ public IReportCreator Run(ReadOnlyCollection<AssemblyNode> list)
IReportCreator creator = ReportEngine.CreatePageBuilder(model,r.ToList(),p);
creator.BuildExportList();
return creator;
- }
+ }
+
}
View
37 src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportEngine.cs
@@ -274,7 +274,8 @@ private static void SetSqlParam (IReportModel model,SqlParameter param)
if (String.IsNullOrEmpty(fileName)) {
throw new ArgumentNullException("fileName");
}
- XmlDocument doc = new XmlDocument();
+ var doc = new XmlDocument();
+ /*
try {
doc.Load(fileName);
} catch (XmlException) {
@@ -284,6 +285,10 @@ private static void SetSqlParam (IReportModel model,SqlParameter param)
// TODO: display user-friendly message
throw;
}
+ */
+
+ doc.Load(fileName);
+
BaseItemLoader loader = new BaseItemLoader();
object root = loader.Load(doc.DocumentElement);
@@ -296,9 +301,39 @@ private static void SetSqlParam (IReportModel model,SqlParameter param)
IllegalFileFormatException e = new IllegalFileFormatException();
throw e;
}
+
+// var model = CreateModel (doc);
+ return model;
+ }
+
+
+ public static ReportModel LoadReportModel (Stream stream) {
+ if (stream == null) {
+ throw new ArgumentNullException("stream");
+ }
+
+ var doc = new XmlDocument();
+ doc.Load(stream);
+
+ BaseItemLoader loader = new BaseItemLoader();
+ object root = loader.Load(doc.DocumentElement);
+
+ ReportModel model = root as ReportModel;
+ if (model != null) {
+// model.ReportSettings.FileName = fileName;
+// FilePathConverter.AdjustReportName(model);
+ } else {
+ IllegalFileFormatException e = new IllegalFileFormatException();
+ throw e;
+ }
return model;
}
+ /*
+ private static ReportModel CreateModel(XmlDocument document)
+ {
+
+ }*/
#endregion
#region Preview to Windows PreviewDialog

No commit comments for this range

Something went wrong with that request. Please try again.