Skip to content

Commit 0a6522d

Browse files
committed
Create ExcelDataReader.Desktop
1 parent 78cb6bf commit 0a6522d

20 files changed

+139
-111
lines changed

Excel.4.5/Excel.4.5.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,20 @@
7979
<Compile Include="ExcelOpenXmlReader.cs">
8080
<SubType>Code</SubType>
8181
</Compile>
82-
<Compile Include="Helpers.cs">
83-
<SubType>Code</SubType>
84-
</Compile>
8582
<Compile Include="ExcelBinaryReader.cs" />
8683
<Compile Include="ExcelReaderFactory.cs" />
8784
<Compile Include="IExcelDataReader.cs" />
88-
<Compile Include="Portable\DataHelper.cs" />
89-
<Compile Include="Portable\DatasetHelper.cs" />
90-
<Compile Include="Portable\FileHelper.cs" />
9185
<Compile Include="Properties\AssemblyInfo.cs" />
9286
</ItemGroup>
9387
<ItemGroup>
9488
<None Include="Excel.snk" />
9589
<None Include="packages.config" />
9690
</ItemGroup>
9791
<ItemGroup>
92+
<ProjectReference Include="..\ExcelDataReader.Desktop\ExcelDataReader.Desktop.csproj">
93+
<Project>{7216dcbc-8f38-4115-9b5a-1452eb8dd0bb}</Project>
94+
<Name>ExcelDataReader.Desktop</Name>
95+
</ProjectReference>
9896
<ProjectReference Include="..\ExcelDataReader.Portable\ExcelDataReader.Portable.csproj">
9997
<Project>{00125ee9-759b-4d3e-8a0c-36be6b7e2fb7}</Project>
10098
<Name>ExcelDataReader.Portable</Name>

Excel.4.5/ExcelBinaryReader.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
using System;
22
using System.Data;
33
using System.IO;
4-
using System.Threading.Tasks;
5-
using Excel.Portable;
4+
using ExcelDataReader.Desktop.Portable;
65

76
namespace Excel
87
{

Excel.4.5/ExcelOpenXmlReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using System;
44
using System.Data;
5-
using Excel.Portable;
5+
using ExcelDataReader.Desktop.Portable;
66

77
namespace Excel
88
{

Excel.4.5/ExcelReaderFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.IO;
2-
using Excel.Portable;
2+
using ExcelDataReader.Desktop.Portable;
33
using ExcelDataReader.Portable.Data;
44
using ExcelDataReader.Portable.IO;
55
using PCLStorage;

Excel.Tests.4.5/Excel.Tests.4.5.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
<Project>{D1905BBD-5F3B-4112-90BD-2D97C8B539C9}</Project>
8686
<Name>Excel.4.5</Name>
8787
</ProjectReference>
88+
<ProjectReference Include="..\ExcelDataReader.Desktop\ExcelDataReader.Desktop.csproj">
89+
<Project>{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}</Project>
90+
<Name>ExcelDataReader.Desktop</Name>
91+
</ProjectReference>
8892
<ProjectReference Include="..\ExcelDataReader.Portable\ExcelDataReader.Portable.csproj">
8993
<Project>{00125ee9-759b-4d3e-8a0c-36be6b7e2fb7}</Project>
9094
<Name>ExcelDataReader.Portable</Name>

Excel.Tests.4.5/FileHelperTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Linq;
44
using System.Text;
55
using System.Threading.Tasks;
6-
using Excel.Portable;
6+
using ExcelDataReader.Desktop.Portable;
77
using FluentAssertions;
88
using Microsoft.VisualStudio.TestTools.UnitTesting;
99

Excel.Tests/ExcelBinaryReaderTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,6 @@ public void Test_BlankHeader()
632632
[TestMethod]
633633
public void Test_OpenOffice()
634634
{
635-
ExcelDataReader.Portable.Log.Log.InitializeWith<Log4NetLog>();
636-
637635
IExcelDataReader excelReader =
638636
ExcelReaderFactory.CreateBinaryReader(Helper.GetTestWorkbook("Test_OpenOffice"));
639637
excelReader.IsFirstRowAsColumnNames = true;

Excel.Tests/ExcelOpenXmlReaderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ public void UnicodeCharsTest()
724724
[TestMethod]
725725
public void ZipWorker_Extract_Test()
726726
{
727-
var zipper = new ZipWorker(FileSystem.Current, new Portable.FileHelper());
727+
var zipper = new ZipWorker(FileSystem.Current, new FileHelper());
728728

729729
//this first one isn't a valid xlsx so we are expecting no side effects in the directory tree
730730
zipper.Extract(Helper.GetTestWorkbook("TestChess"));

Excel.Tests/FormatReaderTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using Excel.Core;
32
#if !NET20
43
using ExcelDataReader.Portable.Core;
54
#endif

Excel.4.5/Helpers.cs renamed to ExcelDataReader.Desktop/DatasetHelpers.cs

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,14 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Data;
4-
using System.Globalization;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
74

8-
namespace Excel.Core
5+
namespace ExcelDataReader.Desktop
96
{
107
/// <summary>
118
/// Helpers class
129
/// </summary>
1310
internal static class DatasetHelpers
1411
{
15-
#if CF_DEBUG || CF_RELEASE
16-
17-
/// <summary>
18-
/// Determines whether [is single byte] [the specified encoding].
19-
/// </summary>
20-
/// <param name="encoding">The encoding.</param>
21-
/// <returns>
22-
/// <c>true</c> if [is single byte] [the specified encoding]; otherwise, <c>false</c>.
23-
/// </returns>
24-
public static bool IsSingleByteEncoding(Encoding encoding)
25-
{
26-
return encoding.GetChars(new byte[] { 0xc2, 0xb5 }).Length == 1;
27-
}
28-
#else
29-
30-
/// <summary>
31-
/// Determines whether [is single byte] [the specified encoding].
32-
/// </summary>
33-
/// <param name="encoding">The encoding.</param>
34-
/// <returns>
35-
/// <c>true</c> if [is single byte] [the specified encoding]; otherwise, <c>false</c>.
36-
/// </returns>
37-
// public static bool IsSingleByteEncoding(Encoding encoding)
38-
// {
39-
// return encoding.IsSingleByte;
40-
// }
41-
#endif
42-
43-
// public static double Int64BitsToDouble(long value)
44-
// {
45-
// return BitConverter.ToDouble(BitConverter.GetBytes(value), 0);
46-
// }
47-
48-
// private static Regex re = new Regex("_x([0-9A-F]{4,4})_");
49-
50-
// public static string ConvertEscapeChars(string input)
51-
// {
52-
// return re.Replace(input, m => (((char)UInt32.Parse(m.Groups[1].Value, NumberStyles.HexNumber))).ToString());
53-
// }
54-
55-
// public static object ConvertFromOATime(double value)
56-
// {
57-
// if ((value >= 0.0) && (value < 60.0))
58-
// {
59-
// value++;
60-
// }
61-
// //if (date1904)
62-
// //{
63-
// // Value += 1462.0;
64-
// //}
65-
// return DateTime.FromOADate(value);
66-
// }
67-
6812
internal static void FixDataTypes(DataSet dataset)
6913
{
7014
var tables = new List<DataTable>(dataset.Tables.Count);
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>ExcelDataReader.Desktop</RootNamespace>
11+
<AssemblyName>ExcelDataReader.Desktop</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<PropertyGroup>
33+
<SignAssembly>true</SignAssembly>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<AssemblyOriginatorKeyFile>exceldatareader.snk</AssemblyOriginatorKeyFile>
37+
</PropertyGroup>
38+
<ItemGroup>
39+
<Reference Include="System" />
40+
<Reference Include="System.Core" />
41+
<Reference Include="System.Xml.Linq" />
42+
<Reference Include="System.Data.DataSetExtensions" />
43+
<Reference Include="Microsoft.CSharp" />
44+
<Reference Include="System.Data" />
45+
<Reference Include="System.Xml" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Compile Include="DatasetHelpers.cs" />
49+
<Compile Include="Portable\DataHelper.cs" />
50+
<Compile Include="Portable\DatasetHelper.cs" />
51+
<Compile Include="Portable\FileHelper.cs" />
52+
<Compile Include="Properties\AssemblyInfo.cs" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ProjectReference Include="..\ExcelDataReader.Portable\ExcelDataReader.Portable.csproj">
56+
<Project>{00125ee9-759b-4d3e-8a0c-36be6b7e2fb7}</Project>
57+
<Name>ExcelDataReader.Portable</Name>
58+
</ProjectReference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<None Include="exceldatareader.snk" />
62+
</ItemGroup>
63+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
65+
Other similar extension points exist, see Microsoft.Common.targets.
66+
<Target Name="BeforeBuild">
67+
</Target>
68+
<Target Name="AfterBuild">
69+
</Target>
70+
-->
71+
</Project>

Excel.4.5/Portable/DataHelper.cs renamed to ExcelDataReader.Desktop/Portable/DataHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using ExcelDataReader.Portable.Data;
33

4-
namespace Excel.Portable
4+
namespace ExcelDataReader.Desktop.Portable
55
{
6-
internal class DataHelper : IDataHelper
6+
public class DataHelper : IDataHelper
77
{
88
public bool IsDBNull(object value)
99
{

Excel.4.5/Portable/DatasetHelper.cs renamed to ExcelDataReader.Desktop/Portable/DatasetHelper.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Data;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
7-
using Excel.Core;
83
using ExcelDataReader.Portable.Data;
94

10-
namespace Excel.Portable
5+
namespace ExcelDataReader.Desktop.Portable
116
{
127
public class DatasetHelper : IDatasetHelper
138
{

Excel.4.5/Portable/FileHelper.cs renamed to ExcelDataReader.Desktop/Portable/FileHelper.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62
using ExcelDataReader.Portable.IO;
73

8-
namespace Excel.Portable
4+
namespace ExcelDataReader.Desktop.Portable
95
{
106
public class FileHelper : IFileHelper
117
{
12-
[Obsolete("no longer needed")]
138
public string GetTempPath()
149
{
1510
return System.IO.Path.GetTempPath();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ExcelDataReader.Desktop")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft")]
12+
[assembly: AssemblyProduct("ExcelDataReader.Desktop")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2014")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("6eafa6e6-1019-4025-9d02-d5d345ac5cc7")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
596 Bytes
Binary file not shown.

ExcelDataReader.Portable/Data/IDatasetHelper.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
namespace ExcelDataReader.Portable.Data
88
{
99
/// <summary>
10-
/// Implement this
10+
/// Implement this to provide Dataset support. The platform doesn't need Dataset as such
11+
/// but could implement this to populate some native structure
1112
/// </summary>
1213
public interface IDatasetHelper
1314
{
@@ -55,14 +56,4 @@ public interface IDatasetHelper
5556
void DatasetLoadComplete();
5657
}
5758

58-
//public interface ITableHelper
59-
//{
60-
// void CreateNew(string sheetName);
61-
//}
62-
63-
//public interface ITableHelperFactory
64-
//{
65-
// IDatasetHelper CreateDataset();
66-
// ITableHelper CreateTable();
67-
//}
6859
}

ExcelDataReader.Portable/ExcelDataReader.Portable.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@
122122
<Compile Include="Log\StringExtensions.cs" />
123123
<Compile Include="Properties\AssemblyInfo.cs" />
124124
</ItemGroup>
125-
<ItemGroup>
126-
<Content Include="readme.txt" />
127-
</ItemGroup>
128125
<ItemGroup>
129126
<Reference Include="PCLStorage">
130127
<HintPath>..\packages\PCLStorage.0.9.6\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch\PCLStorage.dll</HintPath>

ExcelDataReader.Portable/readme.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

ExcelDataReader.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{2BC605
2626
.nuget\NuGet.targets = .nuget\NuGet.targets
2727
EndProjectSection
2828
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelDataReader.Desktop", "ExcelDataReader.Desktop\ExcelDataReader.Desktop.csproj", "{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}"
30+
EndProject
2931
Global
3032
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3133
Debug|Any CPU = Debug|Any CPU
@@ -115,6 +117,16 @@ Global
115117
{00125EE9-759B-4D3E-8A0C-36BE6B7E2FB7}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU
116118
{00125EE9-759B-4D3E-8A0C-36BE6B7E2FB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
117119
{00125EE9-759B-4D3E-8A0C-36BE6B7E2FB7}.Release|Any CPU.Build.0 = Release|Any CPU
120+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Debug-net20|Any CPU.ActiveCfg = Debug|Any CPU
123+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Debug-net20|Any CPU.Build.0 = Debug|Any CPU
124+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.MSTEST_DEBUG|Any CPU.ActiveCfg = Release|Any CPU
125+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.MSTEST_DEBUG|Any CPU.Build.0 = Release|Any CPU
126+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.MSTEST_RELEASE|Any CPU.ActiveCfg = Release|Any CPU
127+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.MSTEST_RELEASE|Any CPU.Build.0 = Release|Any CPU
128+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
129+
{7216DCBC-8F38-4115-9B5A-1452EB8DD0BB}.Release|Any CPU.Build.0 = Release|Any CPU
118130
EndGlobalSection
119131
GlobalSection(SolutionProperties) = preSolution
120132
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)