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

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

@ -1,55 +0,0 @@ @@ -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 @@ @@ -1,40 +1,23 @@
//
// 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)
/*
* Created by SharpDevelop.
* User: Forstmeier Peter
* Date: 26.06.2006
* Time: 09:42
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Globalization;
//using System.Windows.Forms;
/// <summary>
/// This Class handles the formatting of Output Values depending on there
/// Type and DbValue
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 30.03.2005 09:14:20
/// </remarks>
namespace SharpReportCore{
public class DefaultFormatter : AbstractFormatter {
namespace SharpReportCore {
public class StandartFormatter : object {
public DefaultFormatter() {
public StandartFormatter() {
}
///<summary>Looks witch formatting Class to use, call the approbiate formatter
@ -78,9 +61,9 @@ namespace SharpReportCore{ @@ -78,9 +61,9 @@ namespace SharpReportCore{
public string BoolValue (string toFormat, string format){
string str = String.Empty;
if (base.CheckFormat(format) == true) {
if (StandartFormatter.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) {
if (StandartFormatter.CheckValue (toFormat)) {
try {
bool b = bool.Parse (toFormat);
str = b.ToString (CultureInfo.CurrentCulture);
@ -98,8 +81,8 @@ namespace SharpReportCore{ @@ -98,8 +81,8 @@ namespace SharpReportCore{
public string IntegerValues(string valueType,string toFormat, string format) {
string str = String.Empty;
if (base.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) {
if (StandartFormatter.CheckFormat(format) == true) {
if (StandartFormatter.CheckValue (toFormat)) {
try {
int number;
switch (valueType) {
@ -136,9 +119,9 @@ namespace SharpReportCore{ @@ -136,9 +119,9 @@ namespace SharpReportCore{
public string DecimalValues(string toFormat, string format) {
string str = String.Empty;
if (base.CheckFormat(format) == true) {
if (StandartFormatter.CheckFormat(format) == true) {
if (base.CheckValue (toFormat)) {
if (StandartFormatter.CheckValue (toFormat)) {
try {
decimal dec = Decimal.Parse(toFormat,
System.Globalization.NumberStyles.Any,
@ -162,7 +145,7 @@ namespace SharpReportCore{ @@ -162,7 +145,7 @@ namespace SharpReportCore{
public string DateValues(string toFormat, string format) {
if (base.CheckFormat(format) == true) {
if (StandartFormatter.CheckFormat(format) == true) {
try {
DateTime date = DateTime.Parse (toFormat.Trim(),
CultureInfo.CurrentCulture.DateTimeFormat);
@ -179,5 +162,19 @@ namespace SharpReportCore{ @@ -179,5 +162,19 @@ namespace SharpReportCore{
}
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 @@ @@ -132,6 +132,7 @@
<Compile Include="BaseItems\TableItem.cs" />
<Compile Include="Exceptions\IllegalQueryException.cs" />
<Compile Include="Events\SectionRenderEventArgs.cs" />
<Compile Include="Printing\Text\StandartFormatter.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="BaseItems" />

Loading…
Cancel
Save