ClassHyperlinkCollection
Manages hyperlinks attached to cell ranges in a worksheet, tracking links through insert/remove operations.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class HyperlinkCollection : CellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>, IEnumerable<SpreadsheetHyperlink>, IEnumerable
Inheritance: objectCellRangeInsertedOrRemovedAwareCollectionBaseCellRangeInsertedOrRemovedAwareCollection<SpreadsheetHyperlink>HyperlinkCollection
Implements:
Inherited Members
Constructors
HyperlinkCollection(Worksheet)
Initializes a new HyperlinkCollection for the specified worksheet.
Declaration
public HyperlinkCollection(Worksheet worksheet)
Parameters
worksheet
The worksheet.
Methods
Add(CellIndex, HyperlinkInfo)
Adds a hyperlink to the specified cell and returns the created hyperlink instance.
Declaration
public SpreadsheetHyperlink Add(CellIndex cellIndex, HyperlinkInfo hyperlinkInfo)
Parameters
cellIndex
Index of the cell.
hyperlinkInfo
The hyperlink info.
Returns
The new hyperlink.
Add(CellRange, HyperlinkInfo)
Adds a hyperlink to the specified cell range, replacing any existing hyperlink in that exact range, and applies hyperlink styling.
Declaration
public SpreadsheetHyperlink Add(CellRange cellRange, HyperlinkInfo hyperlinkInfo)
Parameters
cellRange
The cell range.
hyperlinkInfo
The hyperlink info.
Returns
The new hyperlink.
Add(CellRange, SpreadsheetHyperlink)
Adds the specified element when cellRange is inserted.
Declaration
protected override SpreadsheetHyperlink Add(CellRange cellRange, SpreadsheetHyperlink element)
Parameters
cellRange
The cell range.
element
The element.
Returns
Overrides
Contains(SpreadsheetHyperlink)
Checks whether the specified hyperlink exists in the collection by range equality.
Declaration
public bool Contains(SpreadsheetHyperlink hyperlink)
Parameters
hyperlink
The hyperlink.
Returns
A value indicating whether the collection contains the specified hyperlink.
GetContainingHyperlinks(CellRange)
Finds all hyperlinks whose ranges are fully contained within the specified cell range.
Declaration
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(CellRange cellRange)
Parameters
cellRange
The cell range.
Returns
IEnumerable<SpreadsheetHyperlink>
The collection of contained hyperlinks.
GetContainingHyperlinks(IEnumerable<CellRange>)
Finds all hyperlinks whose ranges are fully contained within any of the specified cell ranges.
Declaration
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(IEnumerable<CellRange> cellRanges)
Parameters
cellRanges
The cell ranges.
Returns
IEnumerable<SpreadsheetHyperlink>
The collection of contained hyperlinks.
GetIntersectingHyperlinks(CellRange)
Finds all hyperlinks whose ranges overlap with the specified cell range.
Declaration
public IEnumerable<SpreadsheetHyperlink> GetIntersectingHyperlinks(CellRange cellRange)
Parameters
cellRange
The cell range.
Returns
IEnumerable<SpreadsheetHyperlink>
The collection of intersecting hyperlinks.
OnChanged()
Called when the collection is changed.
Declaration
protected virtual void OnChanged()
Remove(CellRange)
Removes elements when cellRange is removed.
Remove(SpreadsheetHyperlink)
Removes the specified hyperlink and reverts its cells to default styling.
Declaration
public bool Remove(SpreadsheetHyperlink hyperlink)
Parameters
hyperlink
The hyperlink.
Returns
The value indicating whether the remove was successful.
TryGetHyperlink(CellIndex, out SpreadsheetHyperlink)
Attempts to find any hyperlink intersecting the specified cell, returning the last one if multiple exist.
Declaration
public bool TryGetHyperlink(CellIndex cellIndex, out SpreadsheetHyperlink hyperlink)
Parameters
cellIndex
Index of the cell.
hyperlink
The hyperlink.
Returns
The value indicating whether a hyperlink was found.
TryGetHyperlink(CellRange, out SpreadsheetHyperlink)
Attempts to find any hyperlink intersecting the specified cell range, returning the last one if multiple exist.
Declaration
public bool TryGetHyperlink(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
Parameters
cellRange
The cell range.
hyperlink
The hyperlink.
Returns
The value indicating whether a hyperlink was found.
TryGetHyperlinkExact(CellRange, out SpreadsheetHyperlink)
Attempts to find a hyperlink with a range that exactly matches the specified cell range.
Declaration
public bool TryGetHyperlinkExact(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
Parameters
cellRange
The cell range.
hyperlink
The hyperlink.
Returns
The value indicating whether a hyperlink was found.
Events
Changed
Raised after a hyperlink is added or removed from the collection.