diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx
index 73c2214799..d9f7fd02b7 100644
--- a/data/resources/StringResources.resx
+++ b/data/resources/StringResources.resx
@@ -8276,7 +8276,7 @@ a line break
Win
-
+
Clear console
diff --git a/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs b/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs
index 00c55cadd0..c2799de1c2 100644
--- a/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs
+++ b/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs
@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
+using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items;
@@ -41,6 +42,6 @@ namespace ICSharpCode.CodeQuality.Reporting
protected List FileNames {get;private set;}
- public ReportSettings ReportSettings {get;set;}
+ public IReportSettings ReportSettings {get;set;}
}
}
diff --git a/src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs b/src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs
index 945242fbe3..56c1f78431 100644
--- a/src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs
+++ b/src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs
@@ -256,7 +256,7 @@ namespace Debugger
var s = seqPoints[i];
if (s.ContainsLocation(line, column))
return s;
- if (s.StartLine > line)
+ if (s.StartLine > line || (s.StartLine == line && s.StartColumn > column))
return s;
}
return null;
diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs
index ad9818dcf3..e31cc7b045 100644
--- a/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs
+++ b/src/AddIns/DisplayBindings/ILSpyAddIn/DecompiledViewContent.cs
@@ -27,6 +27,7 @@ using ICSharpCode.AvalonEdit.AddIn;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Core;
using ICSharpCode.Decompiler;
+using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.ILSpyAddIn;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.TypeSystem;
@@ -39,12 +40,13 @@ namespace ICSharpCode.ILSpyAddIn
///
/// Hosts a decompiled type.
///
- class DecompiledViewContent : AbstractViewContentWithoutFile
+ class DecompiledViewContent : AbstractViewContentWithoutFile, IPositionable
{
///
/// Entity to jump to once decompilation has finished.
///
string jumpToEntityIdStringWhenDecompilationFinished;
+ int jumpToLineWhenDecompilationFinished, jumpToColumnWhenDecompilationFinished;
bool decompilationFinished;
@@ -72,6 +74,9 @@ namespace ICSharpCode.ILSpyAddIn
this.codeEditor.FileName = this.DecompiledTypeName.ToFileName();
this.codeEditor.ActiveTextEditor.IsReadOnly = true;
this.codeEditor.ActiveTextEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#");
+
+ this.Services.RemoveService(typeof(IPositionable));
+ this.Services.AddService(typeof(IPositionable), this);
}
#endregion
@@ -169,7 +174,10 @@ namespace ICSharpCode.ILSpyAddIn
codeEditor.Document.UndoStack.ClearAll();
this.decompilationFinished = true;
- JumpToEntity(this.jumpToEntityIdStringWhenDecompilationFinished);
+ if (!string.IsNullOrEmpty(jumpToEntityIdStringWhenDecompilationFinished))
+ JumpToEntity(this.jumpToEntityIdStringWhenDecompilationFinished);
+ else
+ JumpTo(jumpToLineWhenDecompilationFinished, jumpToColumnWhenDecompilationFinished);
// update UI
//UpdateIconMargin();
@@ -228,5 +236,31 @@ namespace ICSharpCode.ILSpyAddIn
}
#endregion
+
+ #region IPositionable implementation
+
+ public void JumpTo(int line, int column)
+ {
+ if (decompilationFinished) {
+ codeEditor.ActiveTextEditorAdapter.JumpTo(line, column);
+ } else {
+ jumpToLineWhenDecompilationFinished = line;
+ jumpToColumnWhenDecompilationFinished = column;
+ }
+ }
+
+ public int Line {
+ get {
+ return codeEditor.ActiveTextEditor.TextArea.Caret.Line;
+ }
+ }
+
+ public int Column {
+ get {
+ return codeEditor.ActiveTextEditor.TextArea.Caret.Column;
+ }
+ }
+
+ #endregion
}
}
diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs
index de246b0a27..525186f71e 100644
--- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs
+++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs
@@ -31,6 +31,7 @@ using ICSharpCode.NRefactory.Semantics;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom.ClassBrowser;
+using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.Search;
using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Project;
@@ -48,7 +49,7 @@ namespace ICSharpCode.ILSpyAddIn
return fileName != null && fileName.StartsWith("ilspy://", StringComparison.OrdinalIgnoreCase);
}
- readonly static ITextSource EmptyFileContent = new StringTextSource("");
+ readonly ITextSource EmptyFileContent = new StringTextSource("", new OnDiskTextSourceVersion(DateTime.MinValue));
public ITextSource GetFileContent(FileName fileName)
{
diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
index 24a89a5cb8..03133d7d5d 100644
--- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
+++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
@@ -29,7 +29,8 @@ namespace ICSharpCode.ILSpyAddIn
var typeName = DecompiledTypeReference.FromTypeDefinition(method.DeclaringTypeDefinition);
if (typeName == null) return null;
SD.Log.DebugFormatted("GetSymbols for: {0}", typeName.ToFileName());
- return SD.ParserService.ParseFile(typeName.ToFileName()) as ILSpyUnresolvedFile;
+ // full parse info required to make ParserService caching possible...
+ return SD.ParserService.Parse(typeName.ToFileName()).UnresolvedFile as ILSpyUnresolvedFile;
}
public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset)
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
index 286fea4f51..19e700f619 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
@@ -115,6 +115,7 @@
+
@@ -140,6 +141,7 @@
+
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/Group_SortColumns.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/Group_SortColumns.cs
new file mode 100644
index 0000000000..4b0b23c3a1
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/Group_SortColumns.cs
@@ -0,0 +1,24 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 29.05.2015
+ * Time: 20:50
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using ICSharpCode.Reporting.BaseClasses;
+
+namespace ICSharpCode.Reporting.Addin.DesignableItems
+{
+ ///
+ /// Description of Group_SortColumns.
+ ///
+ public class SortColumn:ICSharpCode.Reporting.Items.SortColumn
+ {
+ }
+
+ public class GroupColumn:ICSharpCode.Reporting.Items.GroupColumn
+ {
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs
index 5901018a50..5f0c80a252 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs
@@ -8,16 +8,30 @@
*/
using System;
using System.ComponentModel;
+using System.ComponentModel.Design;
using System.Drawing;
+using System.Drawing.Design;
using System.IO;
using ICSharpCode.Reporting.Globals;
-using ICSharpCode.Reporting.Addin.Designer;
+using ICSharpCode.Reporting.Interfaces;
+using ICSharpCode.Reporting.Addin.Dialogs;
namespace ICSharpCode.Reporting.Addin.DesignableItems
{
+ public class ReportSettingsDesigner:ComponentDesigner
+ {
+ const string settingsName = "ReportSettings";
+
+ public override void Initialize(IComponent component)
+ {
+ base.Initialize(component);
+ component.Site.Name = ReportSettingsDesigner.settingsName;
+ }
+ }
+
[Designer(typeof(ReportSettingsDesigner))]
- public class ReportSettings:Component
+ public class ReportSettings:Component,IReportSettings
{
public ReportSettings()
@@ -135,7 +149,6 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
public PushPullModel DataModel {get;set;}
-
// [Category("Parameters")]
// [EditorAttribute ( typeof(ParameterCollectionEditor),
// typeof(System.Drawing.Design.UITypeEditor) )]
@@ -144,8 +157,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
public SortColumnCollection SortColumnsCollection {get;private set;}
+ [Category("Sorting/Grouping")]
+ [EditorAttribute ( typeof(GroupingCollectionEditor), typeof(UITypeEditor) )]
public GroupColumnCollection GroupColumnsCollection {get;private set;}
-
}
}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
index d7da7e7886..8325066e58 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
@@ -38,8 +38,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// Description of ReportRootDesigner.
///
- class ReportRootDesigner: DocumentDesigner
- {
+ class ReportRootDesigner: DocumentDesigner{
ICollection currentSelection;
IDesignerHost host;
MenuCommandService menuCommandService;
@@ -47,12 +46,11 @@ namespace ICSharpCode.Reporting.Addin.Designer
ISelectionService selectionService;
IComponentChangeService componentChangeService;
List sections;
- ICSharpCode.Reporting.Items.ReportSettings reportSettings;
+ ReportSettings reportSettings;
RootReportModel rootReportModel;
- void ShowMessage(Exception e)
- {
+ void ShowMessage(Exception e){
DisplayError(e);
var uiService = (IUIService)host.GetService(typeof(IUIService));
if (uiService != null) {
@@ -61,15 +59,13 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- void InitializeGUI()
- {
- reportSettings = host.Container.Components[1] as ICSharpCode.Reporting.Items.ReportSettings;
+ void InitializeGUI(){
+ reportSettings = host.Container.Components[1] as ReportSettings;
InitializeRootReportModel();
}
- void InitializeRootReportModel ()
- {
+ void InitializeRootReportModel (){
rootReportModel = host.Container.Components[0] as RootReportModel;
rootReportModel.PageMargin = CalculateMargins();
rootReportModel.Page = new Rectangle(new Point(0,0), reportSettings.PageSize);
@@ -78,16 +74,14 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- Margins CalculateMargins ()
- {
+ Margins CalculateMargins (){
return new Margins(reportSettings.LeftMargin,reportSettings.RightMargin,
reportSettings.TopMargin,reportSettings.BottomMargin);
}
#region overrides
- public override void Initialize(IComponent component)
- {
+ public override void Initialize(IComponent component){
base.Initialize(component);
sections = new List();
@@ -143,12 +137,12 @@ namespace ICSharpCode.Reporting.Addin.Designer
this.selectionService.SelectionChanged += new EventHandler(OnSelectionChanged);
}
- this.host = (IDesignerHost)GetService(typeof(IDesignerHost));
+ host = (IDesignerHost)GetService(typeof(IDesignerHost));
- this.menuCommandService = (MenuCommandService)host.GetService(typeof(MenuCommandService));
+ menuCommandService = (MenuCommandService)host.GetService(typeof(MenuCommandService));
if (host != null)
{
- host.LoadComplete += new EventHandler(OnLoadComplete);
+ host.LoadComplete += OnLoadComplete;
}
//Dragdropp only allowed in Section
this.Control.AllowDrop = false;
@@ -162,9 +156,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- protected override void PostFilterProperties(IDictionary properties)
- {
-
+ protected override void PostFilterProperties(IDictionary properties){
TypeProviderHelper.RemoveProperties(properties);
var s = new string[]{"Visible","BackColor",
"Text","MaximumSize","MinimumSize",
@@ -180,21 +172,19 @@ namespace ICSharpCode.Reporting.Addin.Designer
#region Events
- void OnSectionSizeChanged (object sender, EventArgs e)
- {
+ void OnSectionSizeChanged (object sender, EventArgs e){
RecalculateSections();
}
- void RecalculateSections()
- {
+ void RecalculateSections(){
int locY = 50;
+ // disable once ConvertIfStatementToNullCoalescingExpression
if (reportSettings == null) {
- reportSettings = host.Container.Components[1] as ICSharpCode.Reporting.Items.ReportSettings;
+ reportSettings = host.Container.Components[1] as ReportSettings;
}
- foreach (BaseSection section in sections)
- {
+ foreach (BaseSection section in sections){
section.Location = new Point(reportSettings.LeftMargin,locY);
locY = locY + section.Size.Height + DesignerGlobals.GabBetweenSection;
}
@@ -203,21 +193,19 @@ namespace ICSharpCode.Reporting.Addin.Designer
- void OnLoadComplete(object sender, EventArgs e)
- {
+ void OnLoadComplete(object sender, EventArgs e){
var host = (IDesignerHost)sender;
host.LoadComplete -= OnLoadComplete;
InitializeGUI();
}
- void OnComponentAdded(object sender, ComponentEventArgs ce)
- {
+ void OnComponentAdded(object sender, ComponentEventArgs ce){
var section = ce.Component as BaseSection;
if (section != null) {
sections.Add(section);
- section.SizeChanged += new EventHandler( OnSectionSizeChanged);
+ section.SizeChanged += OnSectionSizeChanged;
foreach (Control ctrl in section.Controls) {
AddToHost(ctrl);
host.Container.Add(ctrl);
@@ -228,8 +216,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- void AddToHost (Control ctrl)
- {
+ void AddToHost (Control ctrl){
foreach (Control c1 in ctrl.Controls) {
AddToHost (c1);
}
@@ -237,16 +224,15 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- private void OnComponentChanged(object sender, ComponentChangedEventArgs ce)
- {
+ void OnComponentChanged(object sender, ComponentChangedEventArgs ce){
LoggingService.InfoFormatted("RootDesigner:OnComponentChanged");
var str = String.Format(CultureInfo.CurrentCulture,"RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue);
LoggingService.InfoFormatted(str);
var section = ce.Component as BaseSection;
if (section != null) {
- foreach (BaseSection s in sections)
- {
+ foreach (BaseSection s in sections){
+
if (s.Name == section.Name) {
s.Size = section.Size;
}
@@ -256,22 +242,19 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- void OnComponentChanging(object sender, ComponentChangingEventArgs ce)
- {
+ void OnComponentChanging(object sender, ComponentChangingEventArgs ce){
System.Console.WriteLine("RootDesigner:OnComponentChanging");
// Host.CreateTransaction();
}
- void OnSelectionChanged(object sender, EventArgs e)
- {
+ void OnSelectionChanged(object sender, EventArgs e){
currentSelection = ((ISelectionService)sender).GetSelectedComponents();
}
#endregion
-
public IDesignerHost Host {
get {
if (this.host == null) {
@@ -281,8 +264,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
- public IToolboxService ToolboxService
- {
+ public IToolboxService ToolboxService{
get
{
if (toolboxService == null)
@@ -327,8 +309,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
#region Dispose
- protected override void Dispose(bool disposing)
- {
+ protected override void Dispose(bool disposing){
if (disposing)
{
var componentService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs
index 13ec54300a..29f26dd720 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs
@@ -24,8 +24,8 @@ using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.Reporting.Factories;
+using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items;
-using ICSharpCode.Reporting.Xml;
using ICSharpCode.Reporting.Addin.XML;
namespace ICSharpCode.Reporting.Addin.DesignerBinding
@@ -33,8 +33,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding
class ReportDefinitionDeserializer : ReportDefinitionParser
{
- public static XmlDocument LoadXmlFromStream(Stream stream)
- {
+ public static XmlDocument LoadXmlFromStream(Stream stream){
if (stream == null)
throw new ArgumentNullException("stream");
var xmlDocument = new XmlDocument();
@@ -47,8 +46,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding
}
- public ReportModel CreateModelFromXml(XmlElement elem,IDesignerHost host)
- {
+ public ReportModel CreateModelFromXml(XmlElement elem,IDesignerHost host){
var reportSettings = CreateReportSettings(elem);
var reportModel = ReportModelFactory.Create();
reportModel.ReportSettings = reportSettings;
@@ -71,20 +69,17 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding
}
- static ReportSettings CreateReportSettings(XmlElement elem)
- {
+ IReportSettings CreateReportSettings(XmlElement elem){
XmlNodeList nodes = elem.FirstChild.ChildNodes;
var reportSettingsNode = (XmlElement)nodes[0];
- var modelLoader = new ModelLoader();
- return modelLoader.Load(reportSettingsNode) as ReportSettings;
+ return Load(reportSettingsNode,null) as IReportSettings;
}
- protected override Type GetTypeByName(string ns, string name)
- {
- var a = Assembly.GetExecutingAssembly();
- Type t = a.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name);
- return t;
+ protected override Type GetTypeByName(string ns, string name){
+ var assembly = Assembly.GetExecutingAssembly();
+ Type type = assembly.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name);
+ return type;
}
}
}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/GroupingCollectionEditor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/GroupingCollectionEditor.cs
new file mode 100644
index 0000000000..648fb519f9
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/GroupingCollectionEditor.cs
@@ -0,0 +1,47 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 29.05.2015
+ * Time: 19:24
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Drawing.Design;
+using ICSharpCode.Reporting.Items;
+
+namespace ICSharpCode.Reporting.Addin.Dialogs
+{
+ ///
+ /// Description of GroupingCollectionEditor.
+ ///
+ public class GroupingCollectionEditor:CollectionEditor
+ {
+ Type[] types;
+
+ public GroupingCollectionEditor(Type type):base(type){
+ types = new Type[] {typeof(GroupColumn)};
+ }
+
+
+ protected override Type[] CreateNewItemTypes(){
+ return types;
+ }
+
+
+ protected override object CreateInstance(Type itemType)
+ {
+// if (itemType == typeof(SqlParameter)) {
+// return new SqlParameter();
+// }
+ return base.CreateInstance(typeof(GroupColumn));
+ }
+
+
+ public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context){
+ return UITypeEditorEditStyle.Modal;
+ }
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml
index 27cc0b7627..dd21344019 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml
@@ -1,4 +1,4 @@
-
-
+
@@ -20,21 +20,30 @@
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
-
+ AutoGenerateColumns="False" Grid.Row="1" Grid.RowSpan="5" Margin="5,10,30,5" Width="400" Grid.Column="1">
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs
index bceb85fbb6..b99024953d 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs
@@ -12,6 +12,8 @@ using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.Reporting.BaseClasses;
+using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.SharpDevelop.Project;
using Xceed.Wpf.Toolkit;
using ICSharpCode.Reporting.Addin.Globals;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
@@ -26,47 +28,71 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
List items;
PushModelContext context;
- public PushDataReport()
- {
+ public PushDataReport(){
InitializeComponent();
items = new List();
_DataGrid.ItemsSource = items;
this.context = new PushModelContext();
cboType.ItemsSource = GlobalLists.DataTypeList();
-
+ Projects = GetProjects();
+ _projectsCbo.ItemsSource = Projects;
+ }
+
+
+ IProject SelectedProject {get;set;}
+
+
+ IModelCollection GetProjects(){
+ var solution = SharpDevelop.SD.ProjectService.CurrentSolution;
+ return solution == null ? null : solution.Projects;
+ }
+
+ public IModelCollection Projects {get; private set;}
+
+ IEnumerable GetTypeDefinitions(){
+ if (SelectedProject != null) {
+ var compilation = SharpDevelop.SD.ParserService.GetCompilation(SelectedProject);
+ var definitions = compilation.MainAssembly.TopLevelTypeDefinitions.Where(x => x.Properties.Any());
+ return definitions;
+ }
+ return null;
+ }
+
+
+ #region SolutionCombo
+
+ void _pro_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){
+ SelectedProject = (IProject)e.AddedItems[0];
var definitions = GetTypeDefinitions();
if (definitions.Any()) {
_cboTypes.Visibility = System.Windows.Visibility.Visible;
_availTxt.Visibility = System.Windows.Visibility.Visible;
+ _projTxt.Visibility = System.Windows.Visibility.Visible;
_cboTypes.ItemsSource = definitions;
_cboTypes.SelectedIndex = 0;
+
} else {
var data = new AbstractColumn("MyColumn", typeof(string));
items.Add(data);
_projTxt.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.NoProject");
}
}
-
- static IEnumerable GetTypeDefinitions()
- {
- var currentProject = SharpDevelop.SD.ProjectService.CurrentProject;
- var compilation = SharpDevelop.SD.ParserService.GetCompilation(currentProject);
- var definitions = compilation.MainAssembly.TopLevelTypeDefinitions.Where(x => x.Properties.Any());
- return definitions;
- }
+ #endregion
- #region Combo
+ #region Classes Combo
void _cboTypes_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){
-
- var typeDefinition = (ITypeDefinition)e.AddedItems[0];
- var itemsList = CreateItemsSource(typeDefinition);
- if (itemsList.Count > 0) {
- _DataGrid.ItemsSource = itemsList;
+ if (e.AddedItems.Count > 0) {
+ var typeDefinition = (ITypeDefinition)e.AddedItems[0];
+ var itemsList = CreateItemsSource(typeDefinition);
+ if (itemsList.Count > 0) {
+ _DataGrid.ItemsSource = itemsList;
+ }
}
}
+ #endregion
static List CreateItemsSource(ITypeDefinition typeDefinitions){
return typeDefinitions.Properties.Select(p => new AbstractColumn(){
@@ -74,7 +100,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
DataTypeName = p.ReturnType.ReflectionName
}).ToList();
}
- #endregion
+
void UpdateContext(){
context.Items = (List)_DataGrid.ItemsSource;
@@ -93,6 +119,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
public WizardPageType ReportPageType {
get {return WizardPageType.PushModelPage;}
}
+
#endregion
}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs
index 7c69893561..0fda95f126 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs
@@ -64,7 +64,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard
}
- ReportSettings GenerateBaseSettings (ReportWizardContext context) {
+ IReportSettings GenerateBaseSettings (ReportWizardContext context) {
var pageOneContext = (PageOneContext)context.PageOneContext;
var reportSettings = ReportModel.ReportSettings;
reportSettings.DataModel = pageOneContext.DataModel;
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
index 707962a862..1bc4c69e47 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
@@ -138,6 +138,7 @@
+
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
index afee05d1c4..c3392ecb23 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
@@ -39,18 +39,32 @@ namespace ICSharpCode.Reporting.Arrange
if (exportColumn == null)
throw new ArgumentNullException("exportColumn");
var container = exportColumn as IExportContainer;
- if ((container != null) && (container.ExportedItems.Count > 0)) {
+ if ((container != null) && (container.ExportedItems.Any())) {
List canGrowItems = CreateCanGrowList(container);
- if (canGrowItems.Count > 0) {
+ if (canGrowItems.Any()) {
var containerSize = ArrangeInternal(container);
if (containerSize.Height > container.DesiredSize.Height) {
- container.DesiredSize = new Size(containerSize.Width,containerSize.Height);
+ container.DesiredSize = new Size(containerSize.Width,containerSize.Height + 15);
}
}
}
+
+
+ var fixedElements = container.ExportedItems.Where(x => !x.CanGrow);
+ var growables = container.ExportedItems.Where(x => x.CanGrow);
+
+ foreach (var growable in growables) {
+ var r = new Rectangle(growable.Location,growable.DesiredSize);
+ foreach (var x in fixedElements) {
+ var xr = new Rectangle(x.Location,x.DesiredSize);
+ if (r.IntersectsWith(xr)) {
+ x.Location = new Point(x.Location.X, r.Bottom + 5);
+ }
+ }
+ }
}
-
+
static Size ArrangeInternal(IExportContainer container){
var containerRectangle = container.DisplayRectangle;
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs
index e47c5d5f2e..aa8e1cea4c 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs
@@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
+using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items;
namespace ICSharpCode.Reporting.BaseClasses
@@ -121,7 +122,7 @@ namespace ICSharpCode.Reporting.BaseClasses
#region ReportSettings
- public static int PrintableWidth (this ReportSettings reportSettings) {
+ public static int PrintableWidth (this IReportSettings reportSettings) {
return reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin;
}
#endregion
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
index 00feb39976..3e4cceafd6 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
@@ -43,11 +43,11 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
public class CollectionDataSource:IDataSource
{
readonly DataCollection