Skip to content

Class ExcelSensibilityLabelCollection

Namespace: OfficeOpenXml.SensitivityLabels
Assembly: EPPlus.dll

A collection of sensibility labels applied to a workbook.

public class ExcelSensibilityLabelCollection

Inheritance

object ← ExcelSensibilityLabelCollection

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Labels

Contains sensitivity labels for the package. Only the last sensitivity will be applied on save.

public EPPlusReadOnlyList<IExcelSensibilityLabel> Labels { get; }

Property Value

EPPlusReadOnlyList<IExcelSensibilityLabel>

ProtectionInformation

Property used by the SensibilityLabelHandler to store information about the sensibility label. The information is passed when calling the DecryptPackageAsync and ApplyLabelAndSavePackageAsync methods. DecryptPackageAsync(MemoryStream, string) ApplyLabelAndSavePackageAsync(IPackageInfo, string)

public object ProtectionInformation { get; set; }

Property Value

object

Methods

SetActiveLabelById(string)

Changes the active sensibility label. This will overwrite the active sensibility label and any settings derived from it, if the SensibilityLabelHandler is used.

public void SetActiveLabelById(string id)

Parameters

id string

The id for the sensibility label without heading and traling brackets.

SetActiveLabelById(string, string, eMethod, bool)

Changes the active sensibility label. This will overwrite the active sensibility label and any settings derived from it, if the SensibilityLabelHandler is used.

public void SetActiveLabelById(string id, string siteId, eMethod method = 2, bool clearLabels = true)

Parameters

id string

The id for the sensibility label without heading and traling brackets.

siteId string

The site id for the tenent. This id is used if no SensibilityLabelHandler is set.

method eMethod

Sets the method property. This property is used if no SensibilityLabelHandler is set.

clearLabels bool

If true, will not clear the Labels collection. If false, will set the active sensibility label(if any) to Readonly=true and Enabled=false

SetActiveLabelByName(string)

Changes the active sensibility label. This will overwrite the active sensibility label and any settings derived from it.

public void SetActiveLabelByName(string name)

Parameters

name string