Browse Source

Cleanup Designer

pull/490/head
Peter Forstmeier 12 years ago
parent
commit
2966668611
  1. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Commands/FormsCommands.cs
  2. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs
  3. 12
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseSection.cs
  4. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/LineItemTypeProvider.cs
  5. 12
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/SectionItemTypeProvider.cs
  6. 10
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseLineItem.cs
  7. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportLine.cs
  8. 9
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs
  9. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Commands/FormsCommands.cs

@ -9,6 +9,7 @@
using System; using System;
using System.ComponentModel.Design; using System.ComponentModel.Design;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.Reporting.Addin.Views; using ICSharpCode.Reporting.Addin.Views;
@ -31,7 +32,7 @@ namespace ICSharpCode.Reporting.Addin.Commands
protected static DesignerView ReportDesigner { protected static DesignerView ReportDesigner {
get { get {
var window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; var window = SD.Workbench;
if (window == null) { if (window == null) {
return null; return null;
} }
@ -67,7 +68,8 @@ namespace ICSharpCode.Reporting.Addin.Commands
public override void Run() public override void Run()
{ {
var window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; // var window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
var window = SD.Workbench;
if (window == null) { if (window == null) {
return; return;
} }

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseLineItem.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
throw new ArgumentNullException("graphics"); throw new ArgumentNullException("graphics");
} }
using (var p = new Pen(ForeColor,Thickness)) { using (var p = new Pen(ForeColor,Thickness)) {
p.SetLineCap(StartLineCap,EndLineCap,DashLineCap); p.SetLineCap(StartLineCap,EndLineCap,DashCap.Flat);
graphics.DrawLine(p,fromPoint,toPoint); graphics.DrawLine(p,fromPoint,toPoint);
} }
} }
@ -115,14 +115,14 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
} }
[Category("Appearance")] // [Category("Appearance")]
public DashCap DashLineCap { // public DashCap DashLineCap {
get { return dashLineCap; } // get { return dashLineCap; }
set { // set {
dashLineCap = value; // dashLineCap = value;
Invalidate(); // Invalidate();
} // }
} // }
} }
} }

12
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseSection.cs

@ -43,14 +43,14 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
#region Propertys #region Propertys
//
// [Browsable(false)]
// public int SectionOffset {get;set;}
[Browsable(false)] // [Browsable(false)]
public int SectionOffset {get;set;} // public int SectionMargin {get;set;}
[Browsable(false)]
public int SectionMargin {get;set;}
public bool PageBreakAfter {get;set;} // public bool PageBreakAfter {get;set;}
public bool CanGrow {get;set;} public bool CanGrow {get;set;}

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/LineItemTypeProvider.cs

@ -71,8 +71,8 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider
prop = props.Find("EndLineCap",true); prop = props.Find("EndLineCap",true);
allProperties.Add(prop); allProperties.Add(prop);
prop = props.Find("dashLineCap",true); // prop = props.Find("DashLineCap",true);
allProperties.Add(prop); // allProperties.Add(prop);
prop = props.Find("DashStyle",true); prop = props.Find("DashStyle",true);
allProperties.Add(prop); allProperties.Add(prop);

12
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/SectionItemTypeProvider.cs

@ -55,17 +55,17 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider
TypeProviderHelper.AddDefaultProperties(allProperties,props); TypeProviderHelper.AddDefaultProperties(allProperties,props);
PropertyDescriptor prop = null; PropertyDescriptor prop = null;
prop = props.Find("SectionOffset",true); // prop = props.Find("SectionOffset",true);
allProperties.Add(prop); // allProperties.Add(prop);
prop = props.Find("SectionMargin",true); // prop = props.Find("SectionMargin",true);
allProperties.Add(prop); // allProperties.Add(prop);
prop = props.Find("DrawBorder",true); prop = props.Find("DrawBorder",true);
allProperties.Add(prop); allProperties.Add(prop);
prop = props.Find("PageBreakAfter",true); // prop = props.Find("PageBreakAfter",true);
allProperties.Add(prop); // allProperties.Add(prop);
prop = props.Find("Controls",true); prop = props.Find("Controls",true);
allProperties.Add(prop); allProperties.Add(prop);

10
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseLineItem.cs

@ -16,6 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System.Drawing;
using ICSharpCode.Reporting.Interfaces.Export; using ICSharpCode.Reporting.Interfaces.Export;
using ICSharpCode.Reporting.PageBuilder.ExportColumns; using ICSharpCode.Reporting.PageBuilder.ExportColumns;
@ -41,7 +42,16 @@ namespace ICSharpCode.Reporting.Items{
ex.DashStyle = DashStyle; ex.DashStyle = DashStyle;
ex.StartLineCap = StartLineCap; ex.StartLineCap = StartLineCap;
ex.EndLineCap = EndLineCap; ex.EndLineCap = EndLineCap;
ex.FromPoint = FromPoint;
ex.ToPoint = ToPoint;
return ex; return ex;
} }
public Point FromPoint {get;set;}
public Point ToPoint {get;set;}
} }
} }

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportLine.cs

@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System; using System;
using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using ICSharpCode.Reporting.Exporter.Visitors; using ICSharpCode.Reporting.Exporter.Visitors;
using ICSharpCode.Reporting.Interfaces.Export; using ICSharpCode.Reporting.Interfaces.Export;
@ -60,5 +61,9 @@ namespace ICSharpCode.Reporting.PageBuilder.ExportColumns
public LineCap StartLineCap {get;set;} public LineCap StartLineCap {get;set;}
public LineCap EndLineCap {get;set;} public LineCap EndLineCap {get;set;}
public Point FromPoint {get;set;}
public Point ToPoint {get;set;}
} }
} }

9
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

@ -134,14 +134,15 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
} }
public override void Visit(ExportLine exportGraphics) public override void Visit(ExportLine exportLine)
{ {
var pen = FixedDocumentCreator.CreateWpfPen(exportGraphics); var pen = FixedDocumentCreator.CreateWpfPen(exportLine);
var visual = new DrawingVisual(); var visual = new DrawingVisual();
using (var dc = visual.RenderOpen()){ using (var dc = visual.RenderOpen()){
dc.DrawLine(pen, dc.DrawLine(pen,
new Point(exportGraphics.Location.X, exportGraphics.Location.Y), new Point(exportLine.Location.X + exportLine.FromPoint.X, exportLine.Location.Y + exportLine.FromPoint.Y),
new Point(exportGraphics.Location.X + exportGraphics.Size.Width,exportGraphics.Location.Y)); new Point(exportLine.Location.X + exportLine.ToPoint.X ,
exportLine.Location.Y + exportLine.FromPoint.Y));
} }
var dragingElement = new DrawingElement(visual); var dragingElement = new DrawingElement(visual);
UIElement = dragingElement; UIElement = dragingElement;

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Xml/MycroParser.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.Reporting.Xml
// instantiate the class // instantiate the class
string ns=node.Prefix; string ns=node.Prefix;
string cname=node.LocalName; string cname=node.LocalName;
Type t=GetTypeByName(ns, cname); Type t=GetTypeByName(ns, cname);
// Trace.Assert(t != null, "Type "+cname+" could not be determined."); // Trace.Assert(t != null, "Type "+cname+" could not be determined.");
@ -119,7 +119,7 @@ namespace ICSharpCode.Reporting.Xml
{ {
if (!(child is XmlElement)) continue; if (!(child is XmlElement)) continue;
string pname=child.LocalName; string pname=child.LocalName;
var pi=t.GetProperty(pname); var pi=t.GetProperty(pname);
if (pi==null) if (pi==null)

Loading…
Cancel
Save