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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,18 +0,0 @@ @@ -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 { @@ -50,11 +50,10 @@ namespace SharpReportCore {
private Point detailEnds;
private DefaultFormatter defaultFormatter;
private bool cancel = false;
private bool cancel;
public AbstractRenderer(ReportModel model){
// System.Console.WriteLine("\tConstructor of ABstractRenderer");
protected AbstractRenderer(ReportModel model){
this.reportSettings = model.ReportSettings;
this.sections = model.SectionCollection;
Init();
@ -208,7 +207,7 @@ namespace SharpReportCore { @@ -208,7 +207,7 @@ namespace SharpReportCore {
void FormatBaseReportItem (object sender, FormatOutputEventArgs e) {
if (sender is BaseDataItem) {
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 { @@ -17,25 +17,25 @@ namespace SharpReportCore {
/// <summary>
/// Default constructor - initializes all fields to default values
/// </summary>
private string formatString = String.Empty;
private string stringToFormat = String.Empty;
private string nullValue = String.Empty;
private string formatedString = String.Empty;
private string format;
private string valueToFormat;
private string nullValue;
private string formatedValue;
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.stringToFormat = stringToFormat;
this.valueToFormat = valueToFormat;
}
#region Property's
public string FormatString {
public string Format {
get {
return formatString;
return format;
}
}
public string NullValue {
@ -43,18 +43,18 @@ namespace SharpReportCore { @@ -43,18 +43,18 @@ namespace SharpReportCore {
return nullValue;
}
}
public string StringToFormat {
public string ValueToFormat {
get {
return stringToFormat;
return valueToFormat;
}
}
public string FormatedString {
public string FormatedValue {
get {
return formatedString;
return formatedValue;
}
set {
formatedString = value;
formatedValue = value;
}
}

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

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

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

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

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

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

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

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

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

@ -38,9 +38,9 @@ namespace SharpReportCore{ @@ -38,9 +38,9 @@ namespace SharpReportCore{
/// This class stores all the basic settings of an Report
/// </summary>
///
public class ReportSettings : BaseSettings,SharpReportCore.IStoreable,
SharpReportCore.ISectionRenderer,IDisposable{
public class ReportSettings : BaseSettings,SharpReportCore.IStoreable,
IBaseRenderer,IDisposable{
private string connectionString;
private string commandText;
@ -90,7 +90,7 @@ namespace SharpReportCore{ @@ -90,7 +90,7 @@ namespace SharpReportCore{
/// <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
/// </summary>
/// <param name="reader">See XMLFormReader</param>
@ -379,7 +379,7 @@ namespace SharpReportCore{ @@ -379,7 +379,7 @@ namespace SharpReportCore{
SaveCollectionItems(ctrl,column,prop);
xmlSection.AppendChild(ctrl);
}
} catch (Exception) {
} catch (Exception) {
throw;
}
}

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

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

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

@ -38,13 +38,11 @@ using SharpReportCore; @@ -38,13 +38,11 @@ using SharpReportCore;
namespace SharpReportCore {
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 EventSharpReportEventHandler NoData;
// public event SharpReportParametersEventHandler ParametersRequest;
public event EventHandler <SharpReportParametersEventArgs> ParametersRequest;
public SharpReportEngine() {

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

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

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

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

Loading…
Cancel
Save