Browse Source

More fixes from FxCop

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1036 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 20 years ago
parent
commit
56ea8e3809
  1. 2
      src/AddIns/Misc/SharpReport/SharpReport.sln
  2. 28
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/AbstractColumn.cs
  3. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/AbstractParameter.cs
  4. 25
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/SqlParameter.cs
  5. 14
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs
  6. 28
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs
  7. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseImageItem.cs
  8. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseRectangleItem.cs
  9. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs
  10. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/ConnectionObject.cs
  11. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/GroupSeperator.cs
  12. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
  13. 27
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/BaseListStrategy.cs
  14. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs
  15. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs
  16. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs
  17. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Events/SharpReportEventArgs.cs
  18. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Events/SharpReportParametersEventArgs.cs
  19. 15
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalFileFormat.cs
  20. 8
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingDataSourceException.cs
  21. 9
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportException.cs
  22. 35
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportWrongItemException.cs
  23. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/ISectionRender.cs
  24. 7
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  25. 28
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/FormatOutputEventArgs.cs
  26. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs
  27. 24
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs
  28. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Graphics/FillPatterns.cs
  29. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
  30. 8
      src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs
  31. 1
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj
  32. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
  33. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs
  34. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlFormReader.cs

2
src/AddIns/Misc/SharpReport/SharpReport.sln

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.1009 # SharpDevelop 2.0.0.1034
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReport", "SharpReport\SharpReport.csproj", "{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReport", "SharpReport\SharpReport.csproj", "{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}"

28
src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/AbstractColumn.cs

@ -7,24 +7,22 @@
// the code is regenerated. // the code is regenerated.
// </autogenerated> // </autogenerated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System;
using System;
/// <summary>
/// <summary> /// This class is used as an Abtract Class for all Columns like, AvailableFields,Sorting,Grouping etc.
/// This class is used as an Abtract Class for all Columns like, AvailableFields,Sorting,Grouping etc. ///
/// /// </summary>
/// </summary> /// <remarks>
/// <remarks> /// created by - Forstmeier Peter
/// created by - Forstmeier Peter /// created on - 26.05.2005 16:19:45
/// created on - 26.05.2005 16:19:45 /// </remarks>
/// </remarks> ///
///
namespace SharpReportCore { namespace SharpReportCore {
public class AbstractColumn : object { public class AbstractColumn : object {
string columnName = String.Empty;
Type dataType = null; string columnName;
Type dataType;
public AbstractColumn() { public AbstractColumn() {

6
src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/AbstractParameter.cs

@ -22,9 +22,9 @@ namespace SharpReportCore {
public class AbstractParameter : object { public class AbstractParameter : object {
string parameterName; string parameterName;
string prompt = String.Empty; string prompt;
bool nullable = false; bool nullable;
object defaultValue = null; object defaultValue;
public AbstractParameter() { public AbstractParameter() {
} }

25
src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/SqlParameter.cs

@ -28,8 +28,8 @@ namespace SharpReportCore {
public class SqlParameter : AbstractParameter { public class SqlParameter : AbstractParameter {
DbType dataType; DbType dataType;
object defaultValue = null; object defaultValue;
bool allowBlank = false; // bool allowBlank;
ParameterDirection parameterDirection = ParameterDirection.InputOutput; ParameterDirection parameterDirection = ParameterDirection.InputOutput;
#region Constructor #region Constructor
@ -183,25 +183,14 @@ namespace SharpReportCore {
} }
/// <summary> // /// <summary>
/// Is this parameter used in an Query // /// Is a Blank value allowed
/// </summary> // /// </summary>
// public bool UsedInQuery { // public bool AllowBlank {
// get { // get {
// return usedInQuery; // return allowBlank;
// }
// set {
// usedInQuery = value;
// } // }
// } // }
/// <summary>
/// Is a Blank value allowed
/// </summary>
public bool AllowBlank {
get {
return allowBlank;
}
}
/// <summary> /// <summary>
/// When no value is entered, use this value /// When no value is entered, use this value
/// </summary> /// </summary>

14
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs

@ -23,9 +23,9 @@ namespace SharpReportCore {
public class BaseReportItem : SharpReportCore.BaseReportObject, public class BaseReportItem : SharpReportCore.BaseReportObject,
IItemRenderer,IComponent{ IItemRenderer,IComponent{
private int offset = 0; private int offset;
private int margin = 0; private int margin;
private bool drawBorder = false; private bool drawBorder;
private Color foreColor; private Color foreColor;
private Font font; private Font font;
@ -35,7 +35,7 @@ namespace SharpReportCore {
public event EventHandler Disposed; public event EventHandler Disposed;
public BaseReportItem() :base(){ public BaseReportItem() :base(){
site = null;
} }
#region Event's handling #region Event's handling
@ -46,13 +46,13 @@ namespace SharpReportCore {
/// <param name="formatString">the formatString</param> /// <param name="formatString">the formatString</param>
/// <param name="nullValue">Value to return when there is null in toFormat</param> /// <param name="nullValue">Value to return when there is null in toFormat</param>
/// <returns></returns> /// <returns></returns>
protected string FireFormatOutput(string toFormat,string formatString, string nullValue) { protected string FireFormatOutput(string toFormat,string format, string nullValue) {
if (FormatOutput != null) { if (FormatOutput != null) {
FormatOutputEventArgs ea = new FormatOutputEventArgs (toFormat, FormatOutputEventArgs ea = new FormatOutputEventArgs (toFormat,
formatString, format,
nullValue); nullValue);
FormatOutput (this,ea); FormatOutput (this,ea);
return ea.FormatedString; return ea.FormatedValue;
} }
return toFormat; return toFormat;
} }

28
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs

@ -25,25 +25,25 @@ using System.Drawing;
/// </remarks> /// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
public class BaseReportObject : ISectionRenderer,INotifyPropertyChanged { public class BaseReportObject : IBaseRenderer,INotifyPropertyChanged {
private string name; private string name;
private object parent = null; private object parent;
private bool visible = true; private bool visible = true;
private bool canGrow = false; private bool canGrow ;
private bool canShrink = false; private bool canShrink ;
private bool pageBreakBefore = false; private bool pageBreakBefore;
private bool pageBreakAfter = false; private bool pageBreakAfter;
private bool suspend = true; private bool suspend = true;
private Size size; private Size size;
private Point location; private Point location;
private Color backColor; private Color backColor;
private int sectionOffset = 0; private int sectionOffset;
private int sectionMargin = 0; private int sectionMargin;
public event EventHandler<EventArgs> BeforePrint; public event EventHandler<EventArgs> BeforePrinting;
public event EventHandler<AfterPrintEventArgs> AfterPrint; public event EventHandler<AfterPrintEventArgs> AfterPrinting;
#region SharpReportCore.IPropertyChange interface implementation #region SharpReportCore.IPropertyChange interface implementation
@ -193,15 +193,15 @@ namespace SharpReportCore {
} }
public void OnAfterPrint (PointF afterPrint) { public void OnAfterPrint (PointF afterPrint) {
if (this.AfterPrint != null) { if (this.AfterPrinting != null) {
AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrint); AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrint);
AfterPrint(this, rea); AfterPrinting(this, rea);
} }
} }
public void OnBeforePrint () { public void OnBeforePrint () {
if (this.BeforePrint != null) { if (this.BeforePrinting != null) {
BeforePrint (this,EventArgs.Empty); BeforePrinting (this,EventArgs.Empty);
} }
} }

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseImageItem.cs

@ -29,7 +29,7 @@ namespace SharpReportCore {
/// </summary> /// </summary>
string fileName; string fileName;
Image image; Image image;
bool scaleImageToSize = false; bool scaleImageToSize;
public BaseImageItem():base() { public BaseImageItem():base() {
} }

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseRectangleItem.cs

@ -25,7 +25,7 @@ using System.Drawing;
namespace SharpReportCore { namespace SharpReportCore {
public class BaseRectangleItem : SharpReportCore.BaseGraphicItem,IContainer { public class BaseRectangleItem : SharpReportCore.BaseGraphicItem,IContainer {
private ArrayList arrayList = null; private ArrayList arrayList;
RectangleShape shape = new RectangleShape(); RectangleShape shape = new RectangleShape();
public BaseRectangleItem() { public BaseRectangleItem() {

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs

@ -45,7 +45,7 @@ namespace SharpReportCore {
private bool includeSettings; private bool includeSettings;
//if file is read, supress events //if file is read, supress events
private bool initDone = false; private bool initDone;
private GraphicsUnit graphicsUnit; private GraphicsUnit graphicsUnit;
private Margins defaultMargins = new Margins (50,50,50,50); private Margins defaultMargins = new Margins (50,50,50,50);

4
src/AddIns/Misc/SharpReport/SharpReportCore/ConnectionObject.cs

@ -32,8 +32,8 @@ namespace SharpReportCore {
public ConnectionObject(string connectionString, string password, string username) public ConnectionObject(string connectionString, string password, string username)
{ {
if (connectionString == "") { if (String.IsNullOrEmpty(connectionString)) {
throw new ArgumentNullException("ConnectionObject:ConnectionString"); throw new ArgumentNullException("connectionString");
} }
this.connectionString = connectionString; this.connectionString = connectionString;
this.password = password; this.password = password;

2
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/GroupSeperator.cs

@ -27,7 +27,7 @@ namespace SharpReportCore {
int groupLevel = 0; int groupLevel = 0;
// GroupSeperator parent = null; // GroupSeperator parent = null;
IHierarchicalArray childs = null; IHierarchicalArray childs ;
public GroupSeperator(ColumnCollection owner, int listIndex, object[] values,int groupLevel): public GroupSeperator(ColumnCollection owner, int listIndex, object[] values,int groupLevel):
base(owner,listIndex,values) { base(owner,listIndex,values) {

18
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs

@ -12,6 +12,7 @@ using System.Data;
using System.Data.OleDb; using System.Data.OleDb;
using System.Collections; using System.Collections;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization;
using SharpReportCore; using SharpReportCore;
using System.Windows.Forms; using System.Windows.Forms;
@ -39,14 +40,14 @@ namespace SharpReportCore {
int currentRow = -1; int currentRow = -1;
ReportSettings reportSettings; ReportSettings reportSettings;
object dataSource = null; object dataSource;
string dataMember = string.Empty; string dataMember;
ConnectionObject connectionObject; ConnectionObject connectionObject;
IDbConnection connection = null; IDbConnection connection;
IDataViewStrategy dataViewStrategy = null; IDataViewStrategy dataViewStrategy;
private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1); // private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1);
public event ListChangedEventHandler ListChanged; public event ListChangedEventHandler ListChanged;
public event EventHandler <GroupChangedEventArgs> GroupChanged; public event EventHandler <GroupChangedEventArgs> GroupChanged;
@ -169,7 +170,7 @@ System.Console.WriteLine("CheckAndSetReportSettings");
if (ds.Tables.Count > 0) { if (ds.Tables.Count > 0) {
DataTable tbl; DataTable tbl;
if (this.dataMember == "") { if (String.IsNullOrEmpty(this.dataMember)){
tbl = ds.Tables[0]; tbl = ds.Tables[0];
} else { } else {
DataTableCollection tcol = ds.Tables; DataTableCollection tcol = ds.Tables;
@ -231,7 +232,7 @@ System.Console.WriteLine("CheckAndSetReportSettings");
CheckForAndBuildParams(command,reportSettings); CheckForAndBuildParams(command,reportSettings);
OleDbDataAdapter adapter = new OleDbDataAdapter(command); OleDbDataAdapter adapter = new OleDbDataAdapter(command);
DataSet ds = new DataSet(); DataSet ds = new DataSet();
ds.Locale = CultureInfo.CurrentCulture;
adapter.Fill (ds); adapter.Fill (ds);
System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count); System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count);
return ds; return ds;
@ -277,7 +278,8 @@ System.Console.WriteLine("CheckAndSetReportSettings");
string colName = col.ColumnName; string colName = col.ColumnName;
AbstractColumn c = this.dataViewStrategy.AvailableFields.Find (colName); AbstractColumn c = this.dataViewStrategy.AvailableFields.Find (colName);
if (c == null) { if (c == null) {
string str = String.Format ("<{0}> is not a member of <{1}>",colName,this.reportSettings.ReportName); string str = String.Format (CultureInfo.CurrentCulture,
"<{0}> is not a member of <{1}>",colName,this.reportSettings.ReportName);
throw new SharpReportException(str); throw new SharpReportException(str);
} }
} }

27
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/BaseListStrategy.cs

@ -24,14 +24,14 @@ using SharpReportCore;
namespace SharpReportCore { namespace SharpReportCore {
public abstract class BaseListStrategy :IDataViewStrategy { public abstract class BaseListStrategy :IDataViewStrategy {
private bool isSorted = false; private bool isSorted;
private bool isFiltered = false; private bool isFiltered;
private bool isGrouped = false; private bool isGrouped;
//Index to plain Datat //Index to plain Datat
private SharpArrayList indexList; private SharpArrayList indexList;
private ReportSettings reportSettings = null; private ReportSettings reportSettings;
private IHierarchicalArray hierarchicalList = null; private IHierarchicalArray hierarchicalList;
private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1); private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1);
@ -40,7 +40,8 @@ namespace SharpReportCore {
public event EventHandler <GroupChangedEventArgs> GroupChanged; public event EventHandler <GroupChangedEventArgs> GroupChanged;
#region Constructor #region Constructor
public BaseListStrategy(ReportSettings reportSettings) {
protected BaseListStrategy(ReportSettings reportSettings) {
this.reportSettings = reportSettings; this.reportSettings = reportSettings;
this.indexList = new SharpArrayList(typeof(BaseComparer),"IndexList"); this.indexList = new SharpArrayList(typeof(BaseComparer),"IndexList");
} }
@ -48,7 +49,7 @@ namespace SharpReportCore {
#endregion #endregion
#region Event's #region Event's
protected void FireGroupChange (object source,GroupSeperator groupSeperator) { protected void NotifyGroupChange (object source,GroupSeperator groupSeperator) {
if (this.GroupChanged != null) { if (this.GroupChanged != null) {
this.GroupChanged (source,new GroupChangedEventArgs(groupSeperator)); this.GroupChanged (source,new GroupChangedEventArgs(groupSeperator));
@ -56,7 +57,7 @@ namespace SharpReportCore {
} }
protected void FireResetList(){ protected void NotifyResetList(){
if (this.ListChanged != null) { if (this.ListChanged != null) {
this.ListChanged (this,this.resetList); this.ListChanged (this,this.resetList);
} }
@ -81,9 +82,9 @@ namespace SharpReportCore {
protected void CheckSortArray (ArrayList arr,string text){ protected void CheckSortArray (ArrayList arr,string text){
System.Console.WriteLine(""); // System.Console.WriteLine("");
System.Console.WriteLine("{0}",text); System.Console.WriteLine("{0}",text);
string tabs = String.Empty; // string tabs = String.Empty;
if (arr != null) { if (arr != null) {
int row = 0; int row = 0;
@ -157,6 +158,8 @@ namespace SharpReportCore {
public bool IsFiltered { public bool IsFiltered {
get { get {
return this.isFiltered; return this.isFiltered;
} set {
this.isFiltered = value;
} }
} }
@ -175,7 +178,7 @@ namespace SharpReportCore {
this.isGrouped = true; this.isGrouped = true;
this.isSorted = true; this.isSorted = true;
} else { } else {
throw new NullReferenceException ("BaseListStrategy:Group Sorry, no IndexList"); throw new SharpReportException ("BaseListStrategy:Group Sorry, no IndexList");
} }
} }
@ -285,7 +288,7 @@ namespace SharpReportCore {
} }
public virtual void Reset() { public virtual void Reset() {
this.FireResetList(); this.NotifyResetList();
} }
public virtual void Bind() { public virtual void Bind() {

4
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs

@ -29,7 +29,7 @@ namespace SharpReportCore {
private object firstItem; private object firstItem;
private object current; private object current;
private PropertyDescriptorCollection listProperties = null; private PropertyDescriptorCollection listProperties;
public CollectionStrategy(IList list,string dataMember,ReportSettings reportSettings):base(reportSettings) { public CollectionStrategy(IList list,string dataMember,ReportSettings reportSettings):base(reportSettings) {
if (list.Count > 0) { if (list.Count > 0) {
@ -211,7 +211,7 @@ namespace SharpReportCore {
this.Sort (); this.Sort ();
this.Reset(); this.Reset();
base.FireResetList(); base.NotifyResetList();
} }
public override void Fill(IItemRenderer item) { public override void Fill(IItemRenderer item) {

6
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs

@ -259,7 +259,7 @@ namespace SharpReportCore {
if ((base.ReportSettings.GroupColumnsCollection != null) && (base.ReportSettings.GroupColumnsCollection.Count > 0)) { if ((base.ReportSettings.GroupColumnsCollection != null) && (base.ReportSettings.GroupColumnsCollection.Count > 0)) {
this.Group (); this.Group ();
Reset(); Reset();
base.FireResetList(); base.NotifyResetList();
return; return;
} }
@ -267,7 +267,7 @@ namespace SharpReportCore {
this.Sort (); this.Sort ();
} }
Reset(); Reset();
base.FireResetList(); base.NotifyResetList();
} }
@ -350,7 +350,7 @@ namespace SharpReportCore {
GroupSeperator sep = bc as GroupSeperator; GroupSeperator sep = bc as GroupSeperator;
if (sep != null) { if (sep != null) {
base.FireGroupChange(this,sep); base.NotifyGroupChange(this,sep);
} }
row = this.view[((BaseComparer)base.IndexList[value]).ListIndex]; row = this.view[((BaseComparer)base.IndexList[value]).ListIndex];
} }

18
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs

@ -21,35 +21,33 @@ namespace SharpReportCore
internal string DELETE = "DELETE"; internal string DELETE = "DELETE";
internal string INSERT = "INSERT"; internal string INSERT = "INSERT";
internal string noValidMessage = "is no valid Member of SqlString"; internal string noValidMessage = "is no valid Member of SqlString";
private string queryString;
public SqlQueryCkecker(){ public SqlQueryCkecker(){
} }
public void Check (string queryString) { public void Check (string queryString) {
if (queryString != "") { if (!String.IsNullOrEmpty(queryString)) {
this.queryString = queryString.ToUpper(CultureInfo.CurrentCulture); queryString = queryString.ToUpper(CultureInfo.CurrentCulture);
if (this.queryString.IndexOf (this.UPDATE) > -1) { if (queryString.IndexOf (this.UPDATE) > -1) {
string str = String.Format("{0} is no valid Member of SqlString",this.UPDATE);
this.Invalid (this.UPDATE); this.Invalid (this.UPDATE);
} }
if (this.queryString.IndexOf(this.DELETE) > -1) { if (queryString.IndexOf(this.DELETE) > -1) {
this.Invalid (this.DELETE); this.Invalid (this.DELETE);
string str = String.Format("{0} is no valid Member of SqlString",this.DELETE);
} }
if (this.queryString.IndexOf(this.INSERT) > -1) { if (queryString.IndexOf(this.INSERT) > -1) {
this.Invalid (this.INSERT); this.Invalid (this.INSERT);
string str = String.Format("{0} is no valid Member of SqlString",this.DELETE);
} }
} }
} }
private void Invalid (string invalidArgument) { private void Invalid (string invalidArgument) {
string str = String.Format("{0} {1}",invalidArgument,this.noValidMessage);
string str = String.Format(CultureInfo.CurrentCulture,
"{0} {1}",invalidArgument,this.noValidMessage);
throw new SharpReportCore.SharpReportException(str); throw new SharpReportCore.SharpReportException(str);
} }
} }

2
src/AddIns/Misc/SharpReport/SharpReportCore/Events/SharpReportEventArgs.cs

@ -27,7 +27,7 @@ namespace SharpReportCore {
/// Default constructor - initializes all fields to default values /// Default constructor - initializes all fields to default values
/// </summary> /// </summary>
bool cancel = false; bool cancel;
int pageNumber ; int pageNumber ;

2
src/AddIns/Misc/SharpReport/SharpReportCore/Events/SharpReportParametersEventArgs.cs

@ -24,7 +24,7 @@ namespace SharpReportCore {
public class SharpReportParametersEventArgs : System.EventArgs { public class SharpReportParametersEventArgs : System.EventArgs {
AbstractParametersCollection sqlParametersCollection = null; AbstractParametersCollection sqlParametersCollection;
string reportName; string reportName;
public SharpReportParametersEventArgs () { public SharpReportParametersEventArgs () {

15
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalFileFormat.cs

@ -9,6 +9,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System; using System;
using System.Runtime.Serialization;
/// <summary> /// <summary>
/// This exception is throw'n when something is wrong with the File Format /// This exception is throw'n when something is wrong with the File Format
@ -18,21 +19,31 @@ using System;
/// created on - 25.04.2005 14:29:20 /// created on - 25.04.2005 14:29:20
/// </remarks> /// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
[Serializable()]
public class IllegalFileFormatException : System.Exception { public class IllegalFileFormatException : System.Exception {
static string errMess = "<aus code> Could not read file , file corrupt (SharpReportFile is improperly formatted)"; static string errMess = "<aus code> Could not read file , file corrupt (SharpReportFile is improperly formatted)";
private string localisedMessage = String.Empty; private string localisedMessage = String.Empty;
public IllegalFileFormatException():base (errMess){ public IllegalFileFormatException():base (errMess){
} }
public IllegalFileFormatException(string errorMessage,
Exception exception):base (errorMessage,exception){
}
public IllegalFileFormatException(string localisedMessage):base(localisedMessage) public IllegalFileFormatException(string localisedMessage):base(localisedMessage)
{ {
this.localisedMessage = localisedMessage; this.localisedMessage = localisedMessage;
} }
protected IllegalFileFormatException(SerializationInfo info,
StreamingContext context) : base(info, context){
// Implement type-specific serialization constructor logic.
}
public string LocalisedMessage { public string LocalisedMessage {
get { get {
return localisedMessage; return localisedMessage;

8
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingDataSourceException.cs

@ -9,7 +9,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System; using System;
using System.Runtime.Serialization;
/// <summary> /// <summary>
/// Throwen when no valid SharpReportCore is available or when SharpReportCore == null /// Throwen when no valid SharpReportCore is available or when SharpReportCore == null
/// </summary> /// </summary>
@ -22,6 +22,7 @@ using System;
/// </remarks> /// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
[Serializable()]
public class MissingDataSourceException : System.Exception { public class MissingDataSourceException : System.Exception {
string errorMessage = String.Empty; string errorMessage = String.Empty;
@ -38,6 +39,11 @@ namespace SharpReportCore {
Exception exception):base (errorMessage,exception){ Exception exception):base (errorMessage,exception){
} }
protected MissingDataSourceException(SerializationInfo info,
StreamingContext context) : base(info, context){
// Implement type-specific serialization constructor logic.
}
public string ErrorMessage { public string ErrorMessage {
get { get {
return errorMessage; return errorMessage;

9
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportException.cs

@ -10,7 +10,7 @@
using System; using System;
using System.Windows.Forms; using System.Runtime.Serialization;
/// <summary> /// <summary>
/// This Class throws the Standart SharpReport Error /// This Class throws the Standart SharpReport Error
@ -21,7 +21,8 @@ using System.Windows.Forms;
/// </remarks> /// </remarks>
/// ///
namespace SharpReportCore { namespace SharpReportCore {
public class SharpReportException : System.Exception { [Serializable()]
public class SharpReportException : System.Exception {
string errorMessage = String.Empty; string errorMessage = String.Empty;
@ -36,6 +37,10 @@ namespace SharpReportCore {
} }
protected SharpReportException(SerializationInfo info,
StreamingContext context) : base(info, context){
// Implement type-specific serialization constructor logic.
}
public string ErrorMessage { public string ErrorMessage {
get { get {
return errorMessage; return errorMessage;

35
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportWrongItemException.cs

@ -7,35 +7,40 @@
// the code is regenerated. // the code is regenerated.
// </autogenerated> // </autogenerated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System;
using System.Runtime.Serialization;
namespace SharpReportCore { /// <summary>
using System; /// This Exception is throwen
/// </summary>
/// <remarks>
/// <summary> /// created by - Forstmeier Peter
/// This Exception is throwen /// created on - 28.09.2005 14:00:34
/// </summary> /// </remarks>
/// <remarks> namespace SharpReportCore {
/// created by - Forstmeier Peter [Serializable()]
/// created on - 28.09.2005 14:00:34 public class UnkownItemException : System.Exception {
/// </remarks>
public class SharpReportUnkownItemException : System.Exception {
string errorMessage = String.Empty; string errorMessage = String.Empty;
public SharpReportUnkownItemException():base() { public UnkownItemException():base() {
this.errorMessage = "Unkown ReportItemType"; this.errorMessage = "Unkown ReportItemType";
} }
public SharpReportUnkownItemException(string errorMessage):base(errorMessage) public UnkownItemException(string errorMessage):base(errorMessage)
{ {
this.errorMessage = errorMessage; this.errorMessage = errorMessage;
} }
public SharpReportUnkownItemException(string errorMessage, public UnkownItemException(string errorMessage,
Exception exception):base (errorMessage,exception){ Exception exception):base (errorMessage,exception){
} }
protected UnkownItemException(SerializationInfo info,
StreamingContext context) : base(info, context){
// Implement type-specific serialization constructor logic.
}
public string ErrorMessage { public string ErrorMessage {
get { get {
return errorMessage; return errorMessage;

18
src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/ISectionRender.cs

@ -1,18 +0,0 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Helmut
* Date: 29.11.2004
* Time: 16:53
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace SharpReportCore{
/// <summary>
/// Section Interface
/// </summary>
public interface ISectionRenderer :IBaseRenderer{
}
}

7
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs

@ -50,11 +50,10 @@ namespace SharpReportCore {
private Point detailEnds; private Point detailEnds;
private DefaultFormatter defaultFormatter; private DefaultFormatter defaultFormatter;
private bool cancel = false; private bool cancel;
public AbstractRenderer(ReportModel model){ protected AbstractRenderer(ReportModel model){
// System.Console.WriteLine("\tConstructor of ABstractRenderer");
this.reportSettings = model.ReportSettings; this.reportSettings = model.ReportSettings;
this.sections = model.SectionCollection; this.sections = model.SectionCollection;
Init(); Init();
@ -208,7 +207,7 @@ namespace SharpReportCore {
void FormatBaseReportItem (object sender, FormatOutputEventArgs e) { void FormatBaseReportItem (object sender, FormatOutputEventArgs e) {
if (sender is BaseDataItem) { if (sender is BaseDataItem) {
BaseDataItem i = (BaseDataItem)sender; BaseDataItem i = (BaseDataItem)sender;
e.FormatedString = defaultFormatter.FormatItem (i); e.FormatedValue = defaultFormatter.FormatItem (i);
} }
} }

28
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/FormatOutputEventArgs.cs

@ -17,25 +17,25 @@ namespace SharpReportCore {
/// <summary> /// <summary>
/// Default constructor - initializes all fields to default values /// Default constructor - initializes all fields to default values
/// </summary> /// </summary>
private string formatString = String.Empty; private string format;
private string stringToFormat = String.Empty; private string valueToFormat;
private string nullValue = String.Empty; private string nullValue;
private string formatedString = String.Empty; private string formatedValue;
public FormatOutputEventArgs() { public FormatOutputEventArgs() {
} }
public FormatOutputEventArgs(string stringToFormat,string formatString, string nullValue ) public FormatOutputEventArgs(string valueToFormat,string format, string nullValue )
{ {
this.formatString = formatString; this.format = format;
this.nullValue = nullValue; this.nullValue = nullValue;
this.stringToFormat = stringToFormat; this.valueToFormat = valueToFormat;
} }
#region Property's #region Property's
public string FormatString { public string Format {
get { get {
return formatString; return format;
} }
} }
public string NullValue { public string NullValue {
@ -43,18 +43,18 @@ namespace SharpReportCore {
return nullValue; return nullValue;
} }
} }
public string StringToFormat { public string ValueToFormat {
get { get {
return stringToFormat; return valueToFormat;
} }
} }
public string FormatedString { public string FormatedValue {
get { get {
return formatedString; return formatedValue;
} }
set { set {
formatedString = value; formatedValue = value;
} }
} }

4
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs

@ -38,8 +38,8 @@ namespace SharpReportCore {
public AbstractFormatter() { public AbstractFormatter() {
} }
protected bool CheckFormat (string formatString) { protected bool CheckFormat (string format) {
if (formatString.Length > 0) { if (format.Length > 0) {
return true; return true;
} else { } else {
return false; return false;

24
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs

@ -76,9 +76,9 @@ namespace SharpReportCore{
return retValue; return retValue;
} }
public string BoolValue (string toFormat, string formatString){ public string BoolValue (string toFormat, string format){
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(formatString) == true) { if (base.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (base.CheckValue (toFormat)) {
try { try {
@ -97,13 +97,13 @@ namespace SharpReportCore{
return str; return str;
} }
public string IntegerValues(string intType,string toFormat, string formatString) { public string IntegerValues(string valueType,string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(formatString) == true) { if (base.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (base.CheckValue (toFormat)) {
try { try {
int number; int number;
switch (intType) { switch (valueType) {
case "16": case "16":
number = Int16.Parse (toFormat, number = Int16.Parse (toFormat,
System.Globalization.NumberStyles.Any, System.Globalization.NumberStyles.Any,
@ -121,7 +121,7 @@ namespace SharpReportCore{
throw new ArgumentException("DefaultFormater:IntegerValues Unknown intType "); throw new ArgumentException("DefaultFormater:IntegerValues Unknown intType ");
} }
str = number.ToString (formatString); str = number.ToString (format);
} catch (Exception e) { } catch (Exception e) {
string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message); string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message);
@ -138,9 +138,9 @@ namespace SharpReportCore{
return str; return str;
} }
public string DecimalValues(string toFormat, string formatString) { public string DecimalValues(string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(formatString) == true) { if (base.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (base.CheckValue (toFormat)) {
try { try {
@ -149,7 +149,7 @@ namespace SharpReportCore{
CultureInfo.CurrentCulture.NumberFormat); CultureInfo.CurrentCulture.NumberFormat);
// decimal dec = Convert.ToDecimal (toFormat,NumberFormatInfo.InvariantInfo); // decimal dec = Convert.ToDecimal (toFormat,NumberFormatInfo.InvariantInfo);
str = dec.ToString (formatString); str = dec.ToString (format);
} catch (Exception e) { } catch (Exception e) {
string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message); string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message);
@ -166,13 +166,13 @@ namespace SharpReportCore{
return str; return str;
} }
public string DateValues(string toFormat, string formatString) { public string DateValues(string toFormat, string format) {
if (base.CheckFormat(formatString) == true) { if (base.CheckFormat(format) == true) {
try { try {
DateTime date = DateTime.Parse (toFormat.Trim(), DateTime date = DateTime.Parse (toFormat.Trim(),
CultureInfo.CurrentCulture.DateTimeFormat); CultureInfo.CurrentCulture.DateTimeFormat);
string str = date.ToString(formatString, string str = date.ToString(format,
DateTimeFormatInfo.CurrentInfo); DateTimeFormatInfo.CurrentInfo);
return str.Trim(); return str.Trim();

3
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Graphics/FillPatterns.cs

@ -33,7 +33,8 @@ namespace SharpReportCore {
Color color; Color color;
Brush brush; Brush brush;
public AbstractFillPattern(Color color) {
protected AbstractFillPattern(Color color) {
this.color = color; this.color = color;
} }

4
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs

@ -40,8 +40,8 @@ using SharpReportCore;
namespace SharpReportCore { namespace SharpReportCore {
public class RenderDataReport : SharpReportCore.AbstractRenderer { public class RenderDataReport : SharpReportCore.AbstractRenderer {
private DataManager dataManager = null; private DataManager dataManager;
private PointF currentPoint = new PointF (0,0); private PointF currentPoint;
public RenderDataReport(ReportModel model):base (model){ public RenderDataReport(ReportModel model):base (model){
} }

8
src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs

@ -38,9 +38,9 @@ namespace SharpReportCore{
/// This class stores all the basic settings of an Report /// This class stores all the basic settings of an Report
/// </summary> /// </summary>
/// ///
public class ReportSettings : BaseSettings,SharpReportCore.IStoreable,
SharpReportCore.ISectionRenderer,IDisposable{
public class ReportSettings : BaseSettings,SharpReportCore.IStoreable,
IBaseRenderer,IDisposable{
private string connectionString; private string connectionString;
private string commandText; private string commandText;
@ -90,7 +90,7 @@ namespace SharpReportCore{
/// <summary> /// <summary>
/// Set the values for all Columns that inherit /// Set the values for all Columns that inherit
/// from <see cref="AbstractColumn"></see> like for sorting etc /// from <see cref="AbstractColumn"></see> like for sorting etc
/// </summary> /// </summary>
/// <param name="reader">See XMLFormReader</param> /// <param name="reader">See XMLFormReader</param>
@ -379,7 +379,7 @@ namespace SharpReportCore{
SaveCollectionItems(ctrl,column,prop); SaveCollectionItems(ctrl,column,prop);
xmlSection.AppendChild(ctrl); xmlSection.AppendChild(ctrl);
} }
} catch (Exception) { } catch (Exception) {
throw; throw;
} }
} }

1
src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj

@ -89,7 +89,6 @@
<Compile Include="Interfaces\IItemRenderer.cs" /> <Compile Include="Interfaces\IItemRenderer.cs" />
<Compile Include="Interfaces\IOutputStrategy.cs" /> <Compile Include="Interfaces\IOutputStrategy.cs" />
<Compile Include="Interfaces\IRender.cs" /> <Compile Include="Interfaces\IRender.cs" />
<Compile Include="Interfaces\ISectionRender.cs" />
<Compile Include="Interfaces\IStoreable.cs" /> <Compile Include="Interfaces\IStoreable.cs" />
<Compile Include="Printing\Formatter\AbstractFormatter.cs" /> <Compile Include="Printing\Formatter\AbstractFormatter.cs" />
<Compile Include="Printing\Formatter\DefaultFormatter.cs" /> <Compile Include="Printing\Formatter\DefaultFormatter.cs" />

6
src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs

@ -38,13 +38,11 @@ using SharpReportCore;
namespace SharpReportCore { namespace SharpReportCore {
public class SharpReportEngine : object,IDisposable { public class SharpReportEngine : object,IDisposable {
private PreviewControl previewControl = null; private PreviewControl previewControl;
private ConnectionObject connectionObject = null; private ConnectionObject connectionObject;
public event EventHandler <SharpReportEventArgs> NoData; public event EventHandler <SharpReportEventArgs> NoData;
// public event EventSharpReportEventHandler NoData;
// public event SharpReportParametersEventHandler ParametersRequest;
public event EventHandler <SharpReportParametersEventArgs> ParametersRequest; public event EventHandler <SharpReportParametersEventArgs> ParametersRequest;
public SharpReportEngine() { public SharpReportEngine() {

2
src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs

@ -87,7 +87,7 @@ namespace SharpReportCore {
rpt.Visible = true; rpt.Visible = true;
rpt.ResumeLayout(); rpt.ResumeLayout();
} else { } else {
SharpReportUnkownItemException e = new SharpReportUnkownItemException(); UnkownItemException e = new UnkownItemException();
throw e; throw e;
} }
} catch (Exception ) { } catch (Exception ) {

4
src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlFormReader.cs

@ -153,8 +153,8 @@ namespace SharpReportCore {
fontElement.Attributes.Append(att); fontElement.Attributes.Append(att);
} }
public static Font MakeFont(string fontString) { public static Font MakeFont(string font) {
string s = fontString.Replace(';',','); string s = font.Replace(';',',');
return (Font)XmlFormReader.StringToTypedValue(s,typeof(Font),CultureInfo.InstalledUICulture); return (Font)XmlFormReader.StringToTypedValue(s,typeof(Font),CultureInfo.InstalledUICulture);
} }
/// <summary> /// <summary>

Loading…
Cancel
Save