HyperlinkCollection
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
Initializes a new HyperlinkCollection for the specified worksheet.
Events
Raised after a hyperlink is added or removed from the collection.
public event EventHandler Changed
Methods
Adds a hyperlink to the specified cell and returns the created hyperlink instance.
public SpreadsheetHyperlink Add(CellIndex cellIndex, HyperlinkInfo hyperlinkInfo)
Index of the cell.
hyperlinkInfoHyperlinkInfoThe hyperlink info.
Returns:The new hyperlink.
Adds a hyperlink to the specified cell range, replacing any existing hyperlink in that exact range, and applies hyperlink styling.
public SpreadsheetHyperlink Add(CellRange cellRange, HyperlinkInfo hyperlinkInfo)
The cell range.
hyperlinkInfoHyperlinkInfoThe hyperlink info.
Returns:The new hyperlink.
Adds the specified element when cellRange is inserted.
protected override SpreadsheetHyperlink Add(CellRange cellRange, SpreadsheetHyperlink element)
The cell range.
elementSpreadsheetHyperlinkThe element.
Returns:Overrides:
Checks whether the specified hyperlink exists in the collection by range equality.
public bool Contains(SpreadsheetHyperlink hyperlink)
The hyperlink.
Returns:A value indicating whether the collection contains the specified hyperlink.
Finds all hyperlinks whose ranges are fully contained within the specified cell range.
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(CellRange cellRange)
The cell range.
Returns:IEnumerable<SpreadsheetHyperlink>
The collection of contained hyperlinks.
Finds all hyperlinks whose ranges are fully contained within any of the specified cell ranges.
public IEnumerable<SpreadsheetHyperlink> GetContainingHyperlinks(IEnumerable<CellRange> cellRanges)
The cell ranges.
Returns:IEnumerable<SpreadsheetHyperlink>
The collection of contained hyperlinks.
Finds all hyperlinks whose ranges overlap with the specified cell range.
public IEnumerable<SpreadsheetHyperlink> GetIntersectingHyperlinks(CellRange cellRange)
The cell range.
Returns:IEnumerable<SpreadsheetHyperlink>
The collection of intersecting hyperlinks.
Called when the collection is changed.
protected virtual void OnChanged()
Removes the specified hyperlink and reverts its cells to default styling.
public bool Remove(SpreadsheetHyperlink hyperlink)
The hyperlink.
Returns:The value indicating whether the remove was successful.
Attempts to find any hyperlink intersecting the specified cell, returning the last one if multiple exist.
public bool TryGetHyperlink(CellIndex cellIndex, out SpreadsheetHyperlink hyperlink)
Index of the cell.
hyperlinkSpreadsheetHyperlinkThe hyperlink.
Returns:The value indicating whether a hyperlink was found.
Attempts to find any hyperlink intersecting the specified cell range, returning the last one if multiple exist.
public bool TryGetHyperlink(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
The cell range.
hyperlinkSpreadsheetHyperlinkThe hyperlink.
Returns:The value indicating whether a hyperlink was found.
Attempts to find a hyperlink with a range that exactly matches the specified cell range.
public bool TryGetHyperlinkExact(CellRange cellRange, out SpreadsheetHyperlink hyperlink)
The cell range.
hyperlinkSpreadsheetHyperlinkThe hyperlink.
Returns:The value indicating whether a hyperlink was found.