-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
395 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace ClosedXML.Excel | ||
{ | ||
public interface IXLPivotSource | ||
{ | ||
IDictionary<String, IList<Object>> CachedFields { get; } | ||
XLItemsToRetain ItemsToRetainPerField { get; set; } | ||
IXLPivotSourceReference PivotSourceReference { get; } | ||
Boolean RefreshDataOnOpen { get; set; } | ||
|
||
Boolean SaveSourceData { get; set; } | ||
IList<String> SourceRangeFields { get; } | ||
|
||
IXLPivotSource Refresh(); | ||
|
||
IXLPivotSource SetItemsToRetainPerField(XLItemsToRetain value); | ||
|
||
IXLPivotSource SetRefreshDataOnOpen(); | ||
|
||
IXLPivotSource SetRefreshDataOnOpen(Boolean value); | ||
|
||
IXLPivotSource SetSaveSourceData(); | ||
|
||
IXLPivotSource SetSaveSourceData(Boolean value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace ClosedXML.Excel | ||
{ | ||
public interface IXLPivotSourceReference : IEquatable<IXLPivotSourceReference> | ||
{ | ||
IXLRange SourceRange { get; set; } | ||
IXLTable SourceTable { get; set; } | ||
XLPivotTableSourceType SourceType { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using ClosedXML.Excel.CalcEngine; | ||
using ClosedXML.Excel.Patterns; | ||
using System; | ||
|
||
namespace ClosedXML.Excel | ||
{ | ||
internal class XLPivotSourceReference : IXLPivotSourceReference | ||
{ | ||
private IXLRange sourceRange; | ||
|
||
public IXLRange SourceRange | ||
{ | ||
get { return sourceRange; } | ||
set | ||
{ | ||
if (value is IXLTable) | ||
SourceType = XLPivotTableSourceType.Table; | ||
else | ||
SourceType = XLPivotTableSourceType.Range; | ||
|
||
sourceRange = value; | ||
} | ||
} | ||
|
||
public IXLTable SourceTable | ||
{ | ||
get { return SourceRange as IXLTable; } | ||
set { SourceRange = value; } | ||
} | ||
|
||
public XLPivotTableSourceType SourceType { get; private set; } | ||
|
||
#region IEquatable interface | ||
|
||
public bool Equals(IXLPivotSourceReference other) | ||
{ | ||
if (this.SourceType != other.SourceType) return false; | ||
|
||
switch (this.SourceType) | ||
{ | ||
case XLPivotTableSourceType.Table: | ||
return ClosedXMLValueComparer.DefaultComparer.Compare(this.SourceTable.Name, other.SourceTable.Name) == 0; | ||
|
||
case XLPivotTableSourceType.Range: | ||
var rangeAddressComparer = new XLRangeAddressComparer(true); | ||
return rangeAddressComparer.Equals(this.SourceRange.RangeAddress, other.SourceRange.RangeAddress); | ||
|
||
default: | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
#endregion IEquatable interface | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.