Skip to content
Permalink
Browse files

Moved core classes to Core project

  • Loading branch information...
sumo300 committed Dec 19, 2013
1 parent 6263ce3 commit a44a0c3745e89dadbd374b0c128185ed9c1f54c3
@@ -19,7 +19,7 @@

using System;

namespace SeeSharpShip.Utilities {
namespace SeeSharpShip.Core {
public class CacheItem {
public string Value { get; set; }
public DateTime InsertedOn { get; set; }
@@ -1,4 +1,4 @@
#region SeeSharpShip is Copyright (C) 2011-2011 Michael J. Sumerano.
#region SeeSharpShip is Copyright (C) 2011-2011 Michael J. Sumerano.

// This file is part of SeeSharpShip.
//
@@ -21,7 +21,7 @@
using System.Collections.Generic;
using System.Linq;

namespace SeeSharpShip.Utilities {
namespace SeeSharpShip.Core {
public class EnumHelper {
public static IEnumerable<T> ToEnumerable<T>() where T : struct {
Type enumType = typeof (T);
@@ -1,34 +1,37 @@
#region SeeSharpShip is Copyright (C) 2011-2011 Michael J. Sumerano.
#region SeeSharpShip.Core is Copyright (C) 2011-2013 Michael J. Sumerano.

// This file is part of SeeSharpShip.
// This file is part of SeeSharpShip.Core.
//
// SeeSharpShip is free software: you can redistribute it and/or modify
// SeeSharpShip.Core 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 3 of the License, or
// (at your option) any later version.
//
// SeeSharpShip is distributed in the hope that it will be useful,
// SeeSharpShip.Core 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 SeeSharpShip. If not, see <http://www.gnu.org/licenses/>.
// along with SeeSharpShip.Core. If not, see <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;

namespace SeeSharpShip.Extensions {
namespace SeeSharpShip.Core.Extensions {
public static class StringExtensions {
public static string ToSha1Hash(this string value) {
using (var provider = new SHA1CryptoServiceProvider()) {
return Convert.ToBase64String(provider.ComputeHash(Encoding.ASCII.GetBytes(value)));
}
}

public static string ToAbsHashCodeString(this string value) { return Math.Abs(value.GetHashCode()).ToString(); }
public static string ToAbsHashCodeString(this string value) {
return Math.Abs(value.GetHashCode()).ToString(CultureInfo.InvariantCulture);
}
}
}
}
@@ -0,0 +1,38 @@
#region SeeSharpShip.Core is Copyright (C) 2011-2013 Michael J. Sumerano.

// This file is part of SeeSharpShip.Core.
//
// SeeSharpShip.Core 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 3 of the License, or
// (at your option) any later version.
//
// SeeSharpShip.Core 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 SeeSharpShip.Core. If not, see <http://www.gnu.org/licenses/>.

#endregion

using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("SeeSharpShip.Core")]
[assembly: AssemblyDescription("Core functionality to support the SeeSharpShip library")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("3858a935-0a03-42d7-8e4d-e7a1e74bc17f")]
@@ -20,7 +20,7 @@
using System;
using System.Collections.Generic;

namespace SeeSharpShip.Utilities {
namespace SeeSharpShip.Core {
/// <summary>
/// A simple caching mechanism that uses an internal Dictionary.
/// </summary>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F0DA717C-7A02-4148-9E24-CE2522F0DC35}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SeeSharpShip.Core</RootNamespace>
<AssemblyName>SeeSharpShip.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Versioning\AssemblyVersionInfo.cs">
<Link>Properties\AssemblyVersionInfo.cs</Link>
</Compile>
<Compile Include="CacheItem.cs" />
<Compile Include="EnumHelper.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResponseCache.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -19,7 +19,6 @@

using System;
using NUnit.Framework;
using SeeSharpShip.Extensions;
using SeeSharpShip.Model.Extensions;
using SeeSharpShip.Model.Usps.Domestic;
using SeeSharpShip.Tests.Usps.DomesticBuilders;
@@ -19,7 +19,7 @@

using System;
using NUnit.Framework;
using SeeSharpShip.Utilities;
using SeeSharpShip.Core;

namespace SeeSharpShip.Tests {
[TestFixture]
@@ -72,6 +72,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SeeSharpShip.Core\SeeSharpShip.Core.csproj">
<Project>{f0da717c-7a02-4148-9e24-ce2522f0dc35}</Project>
<Name>SeeSharpShip.Core</Name>
</ProjectReference>
<ProjectReference Include="..\SeeSharpShip.Model\SeeSharpShip.Model.csproj">
<Project>{fc5a0764-decb-483a-86d7-87dfed5a4cac}</Project>
<Name>SeeSharpShip.Model</Name>
@@ -21,7 +21,6 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using SeeSharpShip.Extensions;
using SeeSharpShip.Model.Extensions;
using SeeSharpShip.Model.Usps;
using SeeSharpShip.Model.Usps.Domestic.Request;
@@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Versioning", "Versioning",
Versioning\AssemblyVersionInfo.cs = Versioning\AssemblyVersionInfo.cs
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeeSharpShip.Core", "SeeSharpShip.Core\SeeSharpShip.Core.csproj", "{F0DA717C-7A02-4148-9E24-CE2522F0DC35}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -49,6 +51,10 @@ Global
{FC5A0764-DECB-483A-86D7-87DFED5A4CAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC5A0764-DECB-483A-86D7-87DFED5A4CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC5A0764-DECB-483A-86D7-87DFED5A4CAC}.Release|Any CPU.Build.0 = Release|Any CPU
{F0DA717C-7A02-4148-9E24-CE2522F0DC35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0DA717C-7A02-4148-9E24-CE2522F0DC35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0DA717C-7A02-4148-9E24-CE2522F0DC35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0DA717C-7A02-4148-9E24-CE2522F0DC35}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -48,7 +48,6 @@
<Compile Include="..\Versioning\AssemblyVersionInfo.cs">
<Link>Properties\AssemblyVersionInfo.cs</Link>
</Compile>
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service References\UpsFreightRateService\Reference.cs">
<AutoGen>True</AutoGen>
@@ -66,12 +65,9 @@
<Compile Include="Services\Usps\ITrackService.cs" />
<Compile Include="Services\Usps\PostRequest.cs" />
<Compile Include="Services\Usps\TrackService.cs" />
<Compile Include="Utilities\CacheItem.cs" />
<Compile Include="Services\Usps\IRateService.cs" />
<Compile Include="Services\Usps\RateService.cs" />
<Compile Include="Utilities\ResponseCache.cs" />
<Compile Include="Services\Usps\ServiceInfo.cs" />
<Compile Include="Utilities\EnumHelper.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
@@ -141,6 +137,10 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\SeeSharpShip.Core\SeeSharpShip.Core.csproj">
<Project>{f0da717c-7a02-4148-9e24-ce2522f0dc35}</Project>
<Name>SeeSharpShip.Core</Name>
</ProjectReference>
<ProjectReference Include="..\SeeSharpShip.Model\SeeSharpShip.Model.csproj">
<Project>{fc5a0764-decb-483a-86d7-87dfed5a4cac}</Project>
<Name>SeeSharpShip.Model</Name>
@@ -23,8 +23,8 @@
using System.Net;
using System.Text;
using System.Xml.Linq;
using SeeSharpShip.Extensions;
using SeeSharpShip.Utilities;
using SeeSharpShip.Core;
using SeeSharpShip.Core.Extensions;

namespace SeeSharpShip.Services.Usps {
public class PostRequest : IRequest
@@ -20,7 +20,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SeeSharpShip.Extensions;
using SeeSharpShip.Model.Extensions;
using SeeSharpShip.Model.Usps;
using SeeSharpShip.Model.Usps.Domestic;
@@ -19,7 +19,6 @@

using System;
using System.Xml.Linq;
using SeeSharpShip.Extensions;
using SeeSharpShip.Model.Extensions;
using SeeSharpShip.Model.Usps;

0 comments on commit a44a0c3

Please sign in to comment.
You can’t perform that action at this time.