diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs index e4b8e69..a7dd91f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs @@ -21,9 +21,12 @@ void Unhide(); Boolean IsHidden { get; } Int32 OutlineLevel { get; set; } - void Group(Boolean collapse = false); - void Group(Int32 outlineLevel, Boolean collapse = false); - void Ungroup(Boolean fromAll = false); + void Group(); + void Group(Boolean collapse); + void Group(Int32 outlineLevel); + void Group(Int32 outlineLevel, Boolean collapse); + void Ungroup(); + void Ungroup(Boolean fromAll); void Collapse(); void Expand(); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs index 480a753..380ee97 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs @@ -12,8 +12,11 @@ void AdjustToContents(); void Hide(); void Unhide(); - void Group(Boolean collapse = false); + void Group(); + void Group(Boolean collapse); + void Group(Int32 outlineLevel); void Group(Int32 outlineLevel, Boolean collapse = false); + void Ungroup(); void Ungroup(Boolean fromAll = false); void Collapse(); void Expand(); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs index abf5885..3bf8ec8 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs @@ -307,20 +307,31 @@ } } } - - public void Group(Boolean collapse = false) + public void Group() + { + Group(false); + } + public void Group(Boolean collapse) { if (OutlineLevel < 8) OutlineLevel += 1; Collapsed = collapse; } - public void Group(Int32 outlineLevel, Boolean collapse = false) + public void Group(Int32 outlineLevel) + { + Group(outlineLevel, false); + } + public void Group(Int32 outlineLevel, Boolean collapse) { OutlineLevel = outlineLevel; Collapsed = collapse; } - public void Ungroup(Boolean ungroupFromAll = false) + public void Ungroup() + { + Ungroup(false); + } + public void Ungroup(Boolean ungroupFromAll) { if (ungroupFromAll) { diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs index 0d966f3..1b15d19 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs @@ -156,16 +156,27 @@ { columns.ForEach(c => c.Unhide()); } - - public void Group(Boolean collapse = false) + public void Group() + { + Group(false); + } + public void Group(Int32 outlineLevel) + { + Group(outlineLevel, false); + } + public void Ungroup() + { + Ungroup(false); + } + public void Group(Boolean collapse) { columns.ForEach(c => c.Group(collapse)); } - public void Group(Int32 outlineLevel, Boolean collapse = false) + public void Group(Int32 outlineLevel, Boolean collapse) { columns.ForEach(c => c.Group(outlineLevel, collapse)); } - public void Ungroup(Boolean ungroupFromAll = false) + public void Ungroup(Boolean ungroupFromAll) { columns.ForEach(c => c.Ungroup(ungroupFromAll)); } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/IXLNamedRanges.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/IXLNamedRanges.cs index c081849..24233aa 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/IXLNamedRanges.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/IXLNamedRanges.cs @@ -9,9 +9,12 @@ { IXLNamedRange NamedRange(String rangeName); IXLNamedRange NamedRange(Int32 rangeIndex); - IXLNamedRange Add(String rangeName, String rangeAddress, String comment = null); - IXLNamedRange Add(String rangeName, IXLRange range, String comment = null); - IXLNamedRange Add(String rangeName, IXLRanges ranges, String comment = null); + IXLNamedRange Add(String rangeName, String rangeAddress); + IXLNamedRange Add(String rangeName, IXLRange range); + IXLNamedRange Add(String rangeName, IXLRanges ranges); + IXLNamedRange Add(String rangeName, String rangeAddress, String comment); + IXLNamedRange Add(String rangeName, IXLRange range, String comment); + IXLNamedRange Add(String rangeName, IXLRanges ranges, String comment); void Delete(String rangeName); void Delete(Int32 rangeIndex); void DeleteAll(); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/XLNamedRanges.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/XLNamedRanges.cs index 2e49830..c3b53da 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/XLNamedRanges.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/NamedRanges/XLNamedRanges.cs @@ -27,21 +27,31 @@ return namedRanges.ElementAt(rangeIndex).Value; } - public IXLNamedRange Add(String rangeName, String rangeAddress, String comment = null) + public IXLNamedRange Add(String rangeName, String rangeAddress) + { + return Add(rangeName, rangeAddress, null); + } + public IXLNamedRange Add(String rangeName, IXLRange range) + { + return Add(rangeName, range, null); + } + public IXLNamedRange Add(String rangeName, IXLRanges ranges) + { + return Add(rangeName, ranges, null); + } + public IXLNamedRange Add(String rangeName, String rangeAddress, String comment ) { var namedRange = new XLNamedRange(this, rangeName, rangeAddress, comment); namedRanges.Add(rangeName, namedRange); return namedRange; } - - public IXLNamedRange Add(String rangeName, IXLRange range, String comment = null) + public IXLNamedRange Add(String rangeName, IXLRange range, String comment) { var ranges = new XLRanges(((XLRange)range).Worksheet.Internals.Workbook, range.Style); ranges.Add(range); return Add(rangeName, ranges, comment); } - - public IXLNamedRange Add(String rangeName, IXLRanges ranges, String comment = null) + public IXLNamedRange Add(String rangeName, IXLRanges ranges, String comment) { var namedRange = new XLNamedRange(this, rangeName, ranges, comment); namedRanges.Add(rangeName, namedRange); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLHFItem.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLHFItem.cs index 9b3dac9..4beabc9 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLHFItem.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/IXLHFItem.cs @@ -17,8 +17,12 @@ public interface IXLHFItem { String GetText(XLHFOccurrence occurrence); - void AddText(String text, XLHFOccurrence occurrence = XLHFOccurrence.AllPages, IXLFont xlFont = null); - void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence = XLHFOccurrence.AllPages, IXLFont xlFont = null); + void AddText(String text); + void AddText(XLHFPredefinedText predefinedText); + void AddText(String text, XLHFOccurrence occurrence); + void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence); + void AddText(String text, XLHFOccurrence occurrence, IXLFont xlFont); + void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence, IXLFont xlFont); void Clear(XLHFOccurrence occurrence = XLHFOccurrence.AllPages); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLHFItem.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLHFItem.cs index d5cc0bc..f84aaae 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLHFItem.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/PageSetup/XLHFItem.cs @@ -16,7 +16,24 @@ return String.Empty; } - public void AddText(String text, XLHFOccurrence occurrence = XLHFOccurrence.AllPages, IXLFont xlFont = null) + public void AddText(String text) + { + AddText(text, XLHFOccurrence.AllPages); + } + public void AddText(XLHFPredefinedText predefinedText) + { + AddText(predefinedText, XLHFOccurrence.AllPages); + } + public void AddText(String text, XLHFOccurrence occurrence) + { + AddText(text, occurrence, null); + } + public void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence) + { + AddText(predefinedText, occurrence, null); + } + + public void AddText(String text, XLHFOccurrence occurrence, IXLFont xlFont) { if (text.Length > 0) { @@ -47,7 +64,7 @@ } } - public void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence = XLHFOccurrence.AllPages, IXLFont xlFont = null) + public void AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence, IXLFont xlFont) { String hfText; switch (predefinedText) diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs index 0a2de52..77611b8 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs @@ -12,9 +12,11 @@ IEnumerable CellsUsed(); IXLRangeAddress RangeAddress { get; } IXLCell FirstCell(); - IXLCell FirstCellUsed(Boolean ignoreStyle = true); + IXLCell FirstCellUsed(); + IXLCell FirstCellUsed(Boolean ignoreStyle); IXLCell LastCell(); - IXLCell LastCellUsed(Boolean ignoreStyle = true); + IXLCell LastCellUsed(); + IXLCell LastCellUsed(Boolean ignoreStyle); IXLRange Range(IXLRangeAddress rangeAddress); IXLRange Range(string rangeAddress); IXLRange Range(string firstCellAddress, string lastCellAddress); @@ -25,6 +27,8 @@ IXLRange Merge(); IXLRange AsRange(); Boolean ContainsRange(String rangeAddress); - IXLRange AddToNamed(String rangeName, XLScope scope = XLScope.Workbook, String comment = null); + IXLRange AddToNamed(String rangeName); + IXLRange AddToNamed(String rangeName, XLScope scope); + IXLRange AddToNamed(String rangeName, XLScope scope, String comment); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs index 164046c..8d0c891 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs @@ -20,7 +20,8 @@ void InsertRowsAbove(int numberOfRows); void InsertRowsBelow(int numberOfRows); - void Delete(XLShiftDeletedCells shiftDeleteCells = XLShiftDeletedCells.ShiftCellsLeft); + void Delete(); + void Delete(XLShiftDeletedCells shiftDeleteCells); void Clear(); String FormulaA1 { set; } String FormulaR1C1 { set; } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs index 338a4ea..3afec0e 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs @@ -22,7 +22,8 @@ void InsertRowsAbove(int numberOfRows); void InsertRowsBelow(int numberOfRows); - void Delete(XLShiftDeletedCells shiftDeleteCells = XLShiftDeletedCells.ShiftCellsUp); + void Delete(); + void Delete(XLShiftDeletedCells shiftDeleteCells); void Clear(); String FormulaA1 { set; } String FormulaR1C1 { set; } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs index 8a6fcb9..b567f17 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs @@ -24,8 +24,12 @@ { return this.Cell(this.RowCount(), this.ColumnCount()); } - - public IXLCell FirstCellUsed(Boolean ignoreStyle = true) + + public IXLCell FirstCellUsed() + { + return FirstCellUsed(true); + } + public IXLCell FirstCellUsed(Boolean ignoreStyle) { var cellsUsed = CellsUsed(); if (ignoreStyle) @@ -43,7 +47,11 @@ } } - public IXLCell LastCellUsed(Boolean ignoreStyle = true) + public IXLCell LastCellUsed() + { + return LastCellUsed(true); + } + public IXLCell LastCellUsed(Boolean ignoreStyle) { var cellsUsed = CellsUsed(); if (ignoreStyle) @@ -588,7 +596,15 @@ } } - public IXLRange AddToNamed(String rangeName, XLScope scope = XLScope.Workbook, String comment = null) + public IXLRange AddToNamed(String rangeName) + { + return AddToNamed(rangeName, XLScope.Workbook); + } + public IXLRange AddToNamed(String rangeName, XLScope scope) + { + return AddToNamed(rangeName, XLScope.Workbook, null); + } + public IXLRange AddToNamed(String rangeName, XLScope scope, String comment) { IXLNamedRanges namedRanges; if (scope == XLScope.Workbook) diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs index f6e060b..4d034d5 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs @@ -38,11 +38,15 @@ && c.Address.RowNumber <= lastRow); } - public IXLRange Range(int firstRow, int lastRow) { return Range(firstRow, 1, lastRow, 1); } + + public void Delete() + { + Delete(XLShiftDeletedCells.ShiftCellsLeft); + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs index 6fac31a..44db10e 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs @@ -51,6 +51,11 @@ { return Range(1, firstColumn, 1, lastColumn); } + + public void Delete() + { + Delete(XLShiftDeletedCells.ShiftCellsUp); + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs index 1f9ea2b..8d69e04 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs @@ -22,9 +22,12 @@ void Unhide(); Boolean IsHidden { get; } Int32 OutlineLevel { get; set; } - void Group(Boolean collapse = false); - void Group(Int32 outlineLevel, Boolean collapse = false); - void Ungroup(Boolean fromAll = false); + void Group(); + void Group(Boolean collapse); + void Group(Int32 outlineLevel); + void Group(Int32 outlineLevel, Boolean collapse); + void Ungroup(); + void Ungroup(Boolean fromAll); void Collapse(); void Expand(); } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs index 6f87a9b..9796f9c 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs @@ -12,9 +12,12 @@ void AdjustToContents(); void Hide(); void Unhide(); - void Group(Boolean collapse = false); - void Group(Int32 outlineLevel, Boolean collapse = false); - void Ungroup(Boolean fromAll = false); + void Group(); + void Group(Boolean collapse); + void Group(Int32 outlineLevel); + void Group(Int32 outlineLevel, Boolean collapse); + void Ungroup(); + void Ungroup(Boolean fromAll); void Collapse(); void Expand(); } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs index 067f460..721e158 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs @@ -313,19 +313,31 @@ } } - public void Group(Boolean collapse = false) + public void Group() + { + Group(false); + } + public void Group(Int32 outlineLevel) + { + Group(outlineLevel, false); + } + public void Ungroup() + { + Ungroup(false); + } + public void Group(Boolean collapse) { if (OutlineLevel < 8) OutlineLevel += 1; Collapsed = collapse; } - public void Group(Int32 outlineLevel, Boolean collapse = false) + public void Group(Int32 outlineLevel, Boolean collapse) { OutlineLevel = outlineLevel; Collapsed = collapse; } - public void Ungroup(Boolean ungroupFromAll = false) + public void Ungroup(Boolean ungroupFromAll) { if (ungroupFromAll) { diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs index 23ec0c3..1013836 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs @@ -154,15 +154,27 @@ rows.ForEach(r => r.Unhide()); } - public void Group(Boolean collapse = false) + public void Group() + { + Group(false); + } + public void Group(Int32 outlineLevel) + { + Group(outlineLevel, false); + } + public void Ungroup() + { + Ungroup(false); + } + public void Group(Boolean collapse) { rows.ForEach(r => r.Group(collapse)); } - public void Group(Int32 outlineLevel, Boolean collapse = false) + public void Group(Int32 outlineLevel, Boolean collapse) { rows.ForEach(r => r.Group(outlineLevel, collapse)); } - public void Ungroup(Boolean ungroupFromAll = false) + public void Ungroup(Boolean ungroupFromAll) { rows.ForEach(r => r.Ungroup(ungroupFromAll)); }