diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs index 886a31c686..6531e6e8c8 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs @@ -37,7 +37,7 @@ namespace SharpReportCore { private Point detailStart; private Point detailEnds; - private DefaultFormatter defaultFormatter; + private StandartFormatter standartFormatter; private bool cancel; public event EventHandler SectionRendering; @@ -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 { if (baseDataItem != null) { if (!String.IsNullOrEmpty(baseDataItem.FormatString)) { - rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem); + rpea.FormatedValue = standartFormatter.FormatItem (baseDataItem); } else { rpea.FormatedValue = rpea.ValueToFormat; } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs deleted file mode 100644 index f0faa0858e..0000000000 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/AbstractFormatter.cs +++ /dev/null @@ -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; - - /// - /// Base Class for all Formatters - /// - /// - /// created by - Forstmeier Peter - /// created on - 27.03.2005 18:09:29 - /// -namespace SharpReportCore { - public class AbstractFormatter : object { - - /// - /// Default constructor - initializes all fields to default values - /// - 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; - } - } -} diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs similarity index 74% rename from src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs rename to src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs index d1763096ce..ed0d9da8c1 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Formatter/DefaultFormatter.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs @@ -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; - /// /// This Class handles the formatting of Output Values depending on there /// Type and DbValue /// -/// -/// created by - Forstmeier Peter -/// created on - 30.03.2005 09:14:20 -/// -namespace SharpReportCore{ - public class DefaultFormatter : AbstractFormatter { +namespace SharpReportCore { + public class StandartFormatter : object { - public DefaultFormatter() { + public StandartFormatter() { } ///Looks witch formatting Class to use, call the approbiate formatter @@ -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{ 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{ 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{ 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{ } 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; + } } } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj index 8623c3adb3..f876df77b2 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj @@ -132,6 +132,7 @@ +