Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Commit

Permalink
Added .NET 4.x Support
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Mar 4, 2017
1 parent 83ff3ce commit e397aa7
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/EPPlus.Core.FunctionalTests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"testRunner": "mstest",
"dependencies": {
"dotnet-test-mstest": "1.1.2-preview",
"EPPlus.Core": "1.3.0-*",
"EPPlus.Core": "1.3.1-*",
"MSTest.TestFramework": "1.0.6-preview",
"NETStandard.Library": "1.6.1"
},
Expand Down
5 changes: 3 additions & 2 deletions src/EPPlus.Core/CoreFx/SecurityElement.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if COREFX
using System;
using System.Collections;
using System.Globalization;
using System.IO;
Expand All @@ -7,7 +8,6 @@

namespace System.Security
{

public sealed class SecurityElement
{
private delegate void ToStringHelperFunc(object obj, string str);
Expand Down Expand Up @@ -412,3 +412,4 @@ internal string SearchForTextOfLocalName(string strLocalName)

}
}
#endif
4 changes: 3 additions & 1 deletion src/EPPlus.Core/CoreFx/SecurityElementType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if COREFX
using System;

namespace System.Security
{
Expand All @@ -9,3 +10,4 @@ public enum SecurityElementType
Comment
}
}
#endif
36 changes: 19 additions & 17 deletions src/EPPlus.Core/ExcelRangeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
#endif
using w = System.Windows;
using OfficeOpenXml.Utils;
#if COREFX
using System.Security.Claims;
#endif

namespace OfficeOpenXml
{
Expand Down Expand Up @@ -89,7 +91,7 @@ private class CopiedCell
internal ExcelComment Comment { get; set; }
internal Byte Flag { get; set; }
}
#region Constructors
#region Constructors
internal ExcelRangeBase(ExcelWorksheet xlWorksheet)
{
_worksheet = xlWorksheet;
Expand Down Expand Up @@ -126,8 +128,8 @@ protected internal override void ChangeAddress()
if (string.IsNullOrEmpty(_ws)) _ws = (xlWorksheet == null ? null : xlWorksheet.Name);
SetDelegate();
}
#endregion
#region Set Value Delegates
#endregion
#region Set Value Delegates
private static _changeProp _setUnknownProp = SetUnknown;
private static _changeProp _setSingleProp = SetSingle;
private static _changeProp _setRangeProp = SetRange;
Expand Down Expand Up @@ -236,8 +238,8 @@ private void SetValueAddress(ExcelAddress address, _setValue valueMethod, object
}
}
}
#endregion
#region Set property methods
#endregion
#region Set property methods
private static _setValue _setStyleIdDelegate = Set_StyleID;
private static _setValue _setValueDelegate = Set_Value;
private static _setValue _setHyperLinkDelegate = Set_HyperLink;
Expand Down Expand Up @@ -361,7 +363,7 @@ private static void Set_Comment(ExcelRangeBase range, object value, int row, int
string[] v = (string[])value;
range._worksheet.Comments.Add(new ExcelRangeBase(range._worksheet, GetAddress(range._fromRow, range._fromCol)), v[0], v[1]);
}
#endregion
#endregion
private void SetToSelectedRange()
{
if (_worksheet.View.SelectedRange == "")
Expand Down Expand Up @@ -399,7 +401,7 @@ internal void UpdateAddress(string address)
throw new NotImplementedException();
}

#region Public Properties
#region Public Properties
/// <summary>
/// The styleobject for the range.
/// </summary>
Expand Down Expand Up @@ -1482,8 +1484,8 @@ internal string FullAddressAbsoluteNoFullRowCol
return fullAddress;
}
}
#endregion
#region Private Methods
#endregion
#region Private Methods
/// <summary>
/// Set the value without altering the richtext property
/// </summary>
Expand Down Expand Up @@ -1751,9 +1753,9 @@ private object ConvertData(ExcelTextFormat Format, string v, int col, bool isTex
}
}
}
#endregion
#region Public Methods
#region ConditionalFormatting
#endregion
#region Public Methods
#region ConditionalFormatting
/// <summary>
/// Conditional Formatting for this range.
/// </summary>
Expand All @@ -1764,8 +1766,8 @@ public IRangeConditionalFormatting ConditionalFormatting
return new RangeConditionalFormatting(_worksheet, new ExcelAddress(Address));
}
}
#endregion
#region DataValidation
#endregion
#region DataValidation
/// <summary>
/// Data validation for this range.
/// </summary>
Expand All @@ -1776,8 +1778,8 @@ public IRangeDataValidation DataValidation
return new RangeDataValidation(_worksheet, Address);
}
}
#endregion
#region LoadFromDataReader
#endregion
#region LoadFromDataReader
/// <summary>
/// Load the data from the datareader starting from the top left cell of the range
/// </summary>
Expand Down Expand Up @@ -1836,7 +1838,7 @@ public ExcelRangeBase LoadFromDataReader(IDataReader Reader, bool PrintHeaders)
}
return _worksheet.Cells[_fromRow, _fromCol, row - 1, _fromCol + fieldCount - 1];
}
#endregion
#endregion

#if !COREFX
#region LoadFromDataTable
Expand Down
11 changes: 4 additions & 7 deletions src/EPPlus.Core/Packaging/DotNetZip/CRC32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -804,21 +804,18 @@ void IDisposable.Dispose()
/// </summary>
#if !COREFX
public override void Close()
#else
public void Close()
{
#if !COREFX
base.Close();
if (!_leaveOpen)
_innerStream.Close();
}
#else
public void Close()
{
base.Dispose();
if (!_leaveOpen)
_innerStream.Dispose();
#endif

}
#endif
}

}
}
9 changes: 3 additions & 6 deletions src/EPPlus.Core/Packaging/DotNetZip/OffsetStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,14 @@ void IDisposable.Dispose()

#if !COREFX
public override void Close()
#else
public void Close()
{
#if !COREFX
base.Close();
}
#else
public void Close()
{
base.Dispose();
#endif

}
#endif
}

}
76 changes: 58 additions & 18 deletions src/EPPlus.Core/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.0-*",
"version": "1.3.1-*",

"authors": [ "Vahid Nasiri" ],
"packOptions": {
Expand All @@ -18,29 +18,69 @@
},
"description": "EPPlus.Core is an unofficial port of the EPPlus library to .NET Core.",


"dependencies": {
"CoreCompat.System.Drawing": "1.0.0-beta006",
"NETStandard.Library": "1.6.1",
"System.Collections.NonGeneric": "4.3.0",
"System.Data.Common": "4.3.0",
"System.Reflection": "4.3.0",
"System.Security.Claims": "4.3.0",
"System.Security.Cryptography.Pkcs": "4.3.0",
"System.Security.Cryptography.X509Certificates": "4.3.0",
"System.Threading.Thread": "4.3.0",
"System.Threading.ThreadPool": "4.3.0",
"System.Xml.XmlDocument": "4.3.0",
"System.Xml.XPath.XmlDocument": "4.3.0"
},
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System": "",
"System.Core": "",
"System.Xml": "",
"System.Security": "",
"System.Drawing": "",
"System.Data": "",
"PresentationCore": "",
"System.Web": ""
}
},

"net45": {
"frameworkAssemblies": {
"System": "",
"System.Core": "",
"System.Xml": "",
"System.Security": "",
"System.Drawing": "",
"System.Data": "",
"PresentationCore": "",
"System.Web": ""
}
},

"net46": {
"frameworkAssemblies": {
"System": "",
"System.Core": "",
"System.Xml": "",
"System.Security": "",
"System.Drawing": "",
"System.Data": "",
"PresentationCore": "",
"System.Web": ""
}
},
"netstandard1.3": {
"imports": "dnxcore50"
"imports": "dnxcore50",
"dependencies": {
"CoreCompat.System.Drawing": "1.0.0-beta006",
"NETStandard.Library": "1.6.1",
"System.Collections.NonGeneric": "4.3.0",
"System.Data.Common": "4.3.0",
"System.Reflection": "4.3.0",
"System.Security.Claims": "4.3.0",
"System.Security.Cryptography.Pkcs": "4.3.0",
"System.Security.Cryptography.X509Certificates": "4.3.0",
"System.Threading.Thread": "4.3.0",
"System.Threading.ThreadPool": "4.3.0",
"System.Xml.XmlDocument": "4.3.0",
"System.Xml.XPath.XmlDocument": "4.3.0"
},
"buildOptions": {
"define": [ "COREFX" ]
}
}
},
"buildOptions": {
"xmlDoc": true,
"define": [ "COREFX", "NO_SFX" ],
"define": [ "NO_SFX" ],
"nowarn": [ "1591" ] // 1591: missing xml comment for publicly visible type or member
},
"configurations": {
Expand Down

0 comments on commit e397aa7

Please sign in to comment.