diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..d02b48a
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,11 @@
+root = true
+
+[*]
+end_of_line = crlf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# 4 space indentation
+[*.cs]
+indent_style = space
+indent_size = 4
\ No newline at end of file
diff --git a/ClosedXML/Attributes/ColumnOrderAttribute.cs b/ClosedXML/Attributes/ColumnOrderAttribute.cs
new file mode 100644
index 0000000..b85c541
--- /dev/null
+++ b/ClosedXML/Attributes/ColumnOrderAttribute.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace ClosedXML.Attributes
+{
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
+ public class ColumnOrderAttribute : Attribute
+ {
+ public ColumnOrderAttribute(long order)
+ {
+ this.Order = order;
+ }
+
+ public long Order { get; private set; }
+ }
+}
diff --git a/ClosedXML/ClosedXML.csproj b/ClosedXML/ClosedXML.csproj
index 8b01542..d4073e5 100644
--- a/ClosedXML/ClosedXML.csproj
+++ b/ClosedXML/ClosedXML.csproj
@@ -22,7 +22,7 @@
false
bin\Debug\
DEBUG;TRACE
- NET4
+ NET4;TRACE;DEBUG
prompt
4
1591
@@ -32,7 +32,7 @@
true
bin\Release\
TRACE
- NET4
+ NET4;TRACE
prompt
4
bin\Release\ClosedXML.xml
@@ -61,15 +61,17 @@
+
-
+
+
@@ -321,6 +323,9 @@
+
+ .editorconfig
+
diff --git a/ClosedXML/Excel/CalcEngine/CalcEngine.cs b/ClosedXML/Excel/CalcEngine/CalcEngine.cs
index b946fa2..9ba60b2 100644
--- a/ClosedXML/Excel/CalcEngine/CalcEngine.cs
+++ b/ClosedXML/Excel/CalcEngine/CalcEngine.cs
@@ -9,8 +9,7 @@
using ClosedXML.Excel.CalcEngine;
using ClosedXML.Excel.CalcEngine.Functions;
-namespace ClosedXML.Excel.CalcEngine
-{
+namespace ClosedXML.Excel.CalcEngine {
///
/// CalcEngine parses strings and returns Expression objects that can
/// be evaluated.
@@ -21,19 +20,18 @@
/// Use the RegisterFunction method to define custom functions.
/// Override the GetExternalObject method to add arbitrary variables to the engine scope.
///
- internal class CalcEngine
- {
- //---------------------------------------------------------------------------
- #region ** fields
+ internal class CalcEngine {
+ //---------------------------------------------------------------------------
+ #region ** fields
- // members
- string _expr; // expression being parsed
- int _len; // length of the expression being parsed
- int _ptr; // current pointer into expression
- string _idChars; // valid characters in identifiers (besides alpha and digits)
- Token _token; // current token being parsed
+ // members
+ string _expr; // expression being parsed
+ int _len; // length of the expression being parsed
+ int _ptr; // current pointer into expression
+ string _idChars; // valid characters in identifiers (besides alpha and digits)
+ Token _token; // current token being parsed
Dictionary
- public bool OptimizeExpressions
- {
+ public bool OptimizeExpressions {
get { return _optimize; }
set { _optimize = value; }
}
@@ -154,8 +142,7 @@
/// additional valid characters such as ':' or '!' (used in Excel range references
/// for example).
///
- public string IdentifierChars
- {
+ public string IdentifierChars {
get { return _idChars; }
set { _idChars = value; }
}
@@ -166,8 +153,7 @@
/// Minimum parameter count.
/// Maximum parameter count.
/// Delegate that evaluates the function.
- public void RegisterFunction(string functionName, int parmMin, int parmMax, CalcEngineFunction fn)
- {
+ public void RegisterFunction(string functionName, int parmMin, int parmMax, CalcEngineFunction fn) {
_fnTbl.Add(functionName, new FunctionDefinition(parmMin, parmMax, fn));
}
///
@@ -176,8 +162,7 @@
/// Function name.
/// Parameter count.
/// Delegate that evaluates the function.
- public void RegisterFunction(string functionName, int parmCount, CalcEngineFunction fn)
- {
+ public void RegisterFunction(string functionName, int parmCount, CalcEngineFunction fn) {
RegisterFunction(functionName, parmCount, parmCount, fn);
}
///
@@ -189,8 +174,7 @@
/// range objects based on identifiers that cannot be enumerated at design time
/// (such as "AB12", "A1:AB12", etc.)
///
- public virtual object GetExternalObject(string identifier)
- {
+ public virtual object GetExternalObject(string identifier) {
return null;
}
///
@@ -201,33 +185,28 @@
/// to the CalcEngine, including sub-properties such as "Address.Street". These may
/// be used with expressions just like any other constant.
///
- public virtual object DataContext
- {
+ public virtual object DataContext {
get { return _dataContext; }
set { _dataContext = value; }
}
///
/// Gets the dictionary that contains function definitions.
///
- public Dictionary Functions
- {
+ public Dictionary Functions {
get { return _fnTbl; }
}
///
/// Gets the dictionary that contains simple variables (not in the DataContext).
///
- public Dictionary Variables
- {
+ public Dictionary Variables {
get { return _vars; }
}
///
/// Gets or sets the to use when parsing numbers and dates.
///
- public CultureInfo CultureInfo
- {
+ public CultureInfo CultureInfo {
get { return _ci; }
- set
- {
+ set {
_ci = value;
var nf = _ci.NumberFormat;
_decimal = nf.NumberDecimalSeparator[0];
@@ -236,16 +215,14 @@
}
}
- #endregion
+ #endregion
//---------------------------------------------------------------------------
#region ** token/keyword tables
// build/get static token table
- Dictionary