Skip to content

Commit 54cb508

Browse files
committed
Moved DefaultFormatter and DefaultSource from "Core" to "Extensions".
1 parent 08701a0 commit 54cb508

11 files changed

Lines changed: 30 additions & 11 deletions

File tree

build/NETv3.5/SmartFormat.dll

0 Bytes
Binary file not shown.

build/NETv3.5/SmartFormat.pdb

-38 KB
Binary file not shown.

src/SmartFormat VS2008.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Global
2121
{5B6368BF-B7C3-440F-ABAA-52A48A837A46}.Debug|Any CPU.Build.0 = Debug|Any CPU
2222
{5B6368BF-B7C3-440F-ABAA-52A48A837A46}.Release|Any CPU.ActiveCfg = Release|Any CPU
2323
{5B6368BF-B7C3-440F-ABAA-52A48A837A46}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{54A06E44-EA03-4138-BCD6-C2D47527AA02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{54A06E44-EA03-4138-BCD6-C2D47527AA02}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{54A06E44-EA03-4138-BCD6-C2D47527AA02}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{54A06E44-EA03-4138-BCD6-C2D47527AA02}.Release|Any CPU.Build.0 = Release|Any CPU
2428
EndGlobalSection
2529
GlobalSection(SolutionProperties) = preSolution
2630
HideSolutionNode = FALSE

src/SmartFormat.Demo/SmartFormat.Demo.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<FileAlignment>512</FileAlignment>
1616
</PropertyGroup>
1717
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
18-
<PlatformTarget>x86</PlatformTarget>
18+
<PlatformTarget>AnyCPU</PlatformTarget>
1919
<DebugSymbols>true</DebugSymbols>
2020
<DebugType>full</DebugType>
2121
<Optimize>false</Optimize>
@@ -25,14 +25,22 @@
2525
<WarningLevel>4</WarningLevel>
2626
</PropertyGroup>
2727
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
28-
<PlatformTarget>x86</PlatformTarget>
28+
<PlatformTarget>AnyCPU</PlatformTarget>
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
3131
<OutputPath>bin\Release\</OutputPath>
3232
<DefineConstants>TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
3535
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37+
<PlatformTarget>AnyCPU</PlatformTarget>
38+
<OutputPath>bin\Debug\</OutputPath>
39+
</PropertyGroup>
40+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41+
<PlatformTarget>AnyCPU</PlatformTarget>
42+
<OutputPath>bin\Release\</OutputPath>
43+
</PropertyGroup>
3644
<ItemGroup>
3745
<Reference Include="System" />
3846
<Reference Include="System.Core" />

src/SmartFormat.Tests/CodeProjectExampleTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using NUnit.Framework;
77
using SmartFormat.Core;
88
using SmartFormat.Core.Extensions;
9+
using SmartFormat.Extensions;
910

1011

1112
namespace SmartFormat.Tests

src/SmartFormat.Tests/CoreTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public void TestParser()
4242
[Test]
4343
public void Parser_Throws_Exceptions()
4444
{
45+
// Let's set the "ErrorAction" to "Throw":
46+
var formatter = Smart.CreateDefaultSmartFormat();
47+
formatter.Parser.ErrorAction = ErrorAction.ThrowError;
48+
4549
var args = new object[] { TestFactory.GetPerson() };
4650
var invalidFormats = new[] {
4751
"{",
@@ -61,7 +65,7 @@ public void Parser_Throws_Exceptions()
6165
{
6266
try
6367
{
64-
Smart.Default.Test(format, args, "Error");
68+
formatter.Test(format, args, "Error");
6569
// Make sure that EVERY item has an error:
6670
Assert.Fail("Parsing \"{0}\" should have failed but did not.", format);
6771
}

src/SmartFormat.Tests/PerformanceTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using SmartFormat.Core;
77
using SmartFormat.Core.Extensions;
88
using SmartFormat.Core.Parsing;
9+
using SmartFormat.Extensions;
910

1011
namespace SmartFormat.Tests
1112
{

src/SmartFormat/Core/Extensions/DefaultFormatter.cs renamed to src/SmartFormat/Extensions/DefaultFormatter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using System;
2+
using SmartFormat.Core.Extensions;
23
using SmartFormat.Core.Output;
34
using SmartFormat.Core.Parsing;
45

5-
namespace SmartFormat.Core.Extensions
6+
namespace SmartFormat.Extensions
67
{
78
public class DefaultFormatter : IFormatter
89
{

src/SmartFormat/Core/Extensions/DefaultSource.cs renamed to src/SmartFormat/Extensions/DefaultSource.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using SmartFormat.Core.Parsing;
1+
using SmartFormat.Core.Extensions;
2+
using SmartFormat.Core.Parsing;
23

3-
namespace SmartFormat.Core.Extensions
4+
namespace SmartFormat.Extensions
45
{
56
public class DefaultSource : ISource
67
{

src/SmartFormat/Extensions/PluralLocalizationFormatter.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,4 @@ private static bool Between(this decimal value, decimal min, decimal max)
670670
}
671671
}
672672

673-
674-
675-
676673
}

0 commit comments

Comments
 (0)