Browse Source

Cleanup unused Files

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1520 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 19 years ago
parent
commit
4db9d290f8
  1. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  2. 55
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs
  3. 69
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs
  4. 1
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj

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

@ -37,7 +37,7 @@ namespace SharpReportCore {
private Point detailStart; private Point detailStart;
private Point detailEnds; private Point detailEnds;
private DefaultFormatter defaultFormatter; private StandartFormatter standartFormatter;
private bool cancel; private bool cancel;
public event EventHandler<SectionRenderEventArgs> SectionRendering; public event EventHandler<SectionRenderEventArgs> SectionRendering;
@ -50,7 +50,7 @@ namespace SharpReportCore {
this.reportSettings = model.ReportSettings; this.reportSettings = model.ReportSettings;
this.sections = model.SectionCollection; this.sections = model.SectionCollection;
Init(); Init();
defaultFormatter = new DefaultFormatter(); standartFormatter = new StandartFormatter();
} }
public virtual void SetupRenderer () { public virtual void SetupRenderer () {
@ -308,7 +308,7 @@ namespace SharpReportCore {
if (baseDataItem != null) { if (baseDataItem != null) {
if (!String.IsNullOrEmpty(baseDataItem.FormatString)) { if (!String.IsNullOrEmpty(baseDataItem.FormatString)) {
rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem); rpea.FormatedValue = standartFormatter.FormatItem (baseDataItem);
} else { } else {
rpea.FormatedValue = rpea.ValueToFormat; rpea.FormatedValue = rpea.ValueToFormat;
} }

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

@ -1,55 +0,0 @@
//
// SharpDevelop ReportEditor
//
// Copyright (C) 2005 Peter Forstmeier
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Peter Forstmeier (Peter.Forstmeier@t-online.de)
using System;
/// <summary>
/// Base Class for all Formatters
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 27.03.2005 18:09:29
/// </remarks>
namespace SharpReportCore {
public class AbstractFormatter : object {
/// <summary>
/// Default constructor - initializes all fields to default values
/// </summary>
public AbstractFormatter() {
}
protected bool CheckFormat (string format) {
if (String.IsNullOrEmpty(format)) {
return false;
}
return true;
}
protected bool CheckValue (string toFormat) {
if (String.IsNullOrEmpty(toFormat)) {
return false;
}
return true;
}
}
}

69
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs → src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs

@ -1,40 +1,23 @@
// /*
// SharpDevelop ReportEditor * Created by SharpDevelop.
// * User: Forstmeier Peter
// Copyright (C) 2005 Peter Forstmeier * Date: 26.06.2006
// * Time: 09:42
// This program is free software; you can redistribute it and/or modify *
// it under the terms of the GNU General Public License as published by * To change this template use Tools | Options | Coding | Edit Standard Headers.
// the Free Software Foundation; either version 2 of the License, or */
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Peter Forstmeier (Peter.Forstmeier@t-online.de)
using System; using System;
using System.Globalization; using System.Globalization;
//using System.Windows.Forms;
/// <summary> /// <summary>
/// This Class handles the formatting of Output Values depending on there /// This Class handles the formatting of Output Values depending on there
/// Type and DbValue /// Type and DbValue
/// </summary> /// </summary>
/// <remarks> namespace SharpReportCore {
/// created by - Forstmeier Peter public class StandartFormatter : object {
/// created on - 30.03.2005 09:14:20
/// </remarks>
namespace SharpReportCore{
public class DefaultFormatter : AbstractFormatter {
public DefaultFormatter() { public StandartFormatter() {
} }
///<summary>Looks witch formatting Class to use, call the approbiate formatter ///<summary>Looks witch formatting Class to use, call the approbiate formatter
@ -78,9 +61,9 @@ namespace SharpReportCore{
public string BoolValue (string toFormat, string format){ public string BoolValue (string toFormat, string format){
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(format) == true) { if (StandartFormatter.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (StandartFormatter.CheckValue (toFormat)) {
try { try {
bool b = bool.Parse (toFormat); bool b = bool.Parse (toFormat);
str = b.ToString (CultureInfo.CurrentCulture); str = b.ToString (CultureInfo.CurrentCulture);
@ -98,8 +81,8 @@ namespace SharpReportCore{
public string IntegerValues(string valueType,string toFormat, string format) { public string IntegerValues(string valueType,string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(format) == true) { if (StandartFormatter.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (StandartFormatter.CheckValue (toFormat)) {
try { try {
int number; int number;
switch (valueType) { switch (valueType) {
@ -136,9 +119,9 @@ namespace SharpReportCore{
public string DecimalValues(string toFormat, string format) { public string DecimalValues(string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (base.CheckFormat(format) == true) { if (StandartFormatter.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) { if (StandartFormatter.CheckValue (toFormat)) {
try { try {
decimal dec = Decimal.Parse(toFormat, decimal dec = Decimal.Parse(toFormat,
System.Globalization.NumberStyles.Any, System.Globalization.NumberStyles.Any,
@ -162,7 +145,7 @@ namespace SharpReportCore{
public string DateValues(string toFormat, string format) { public string DateValues(string toFormat, string format) {
if (base.CheckFormat(format) == true) { if (StandartFormatter.CheckFormat(format) == true) {
try { try {
DateTime date = DateTime.Parse (toFormat.Trim(), DateTime date = DateTime.Parse (toFormat.Trim(),
CultureInfo.CurrentCulture.DateTimeFormat); CultureInfo.CurrentCulture.DateTimeFormat);
@ -179,5 +162,19 @@ namespace SharpReportCore{
} }
return toFormat.Trim(); return toFormat.Trim();
} }
private static bool CheckFormat (string format) {
if (String.IsNullOrEmpty(format)) {
return false;
}
return true;
}
private static bool CheckValue (string toFormat) {
if (String.IsNullOrEmpty(toFormat)) {
return false;
}
return true;
}
} }
} }

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

@ -132,6 +132,7 @@
<Compile Include="BaseItems\TableItem.cs" /> <Compile Include="BaseItems\TableItem.cs" />
<Compile Include="Exceptions\IllegalQueryException.cs" /> <Compile Include="Exceptions\IllegalQueryException.cs" />
<Compile Include="Events\SectionRenderEventArgs.cs" /> <Compile Include="Events\SectionRenderEventArgs.cs" />
<Compile Include="Printing\Text\StandartFormatter.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="BaseItems" /> <Folder Include="BaseItems" />

Loading…
Cancel
Save