Show / Hide Table of Contents

Class AttributeType

Represents the attribute type.

Inheritance
System.Object
AttributeType
SAMLAttribute
RequestedAttribute
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Assertions
Assembly: ComponentSpace.Saml2.dll
Syntax
public class AttributeType
Remarks

Refer to the Assertions and Protocol for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.

Constructors

AttributeType()

Initializes a new instance of the AttributeType class.

Declaration
public AttributeType()

AttributeType(String, String, String)

Initializes a new instance of the AttributeType class.

Declaration
public AttributeType(string name, string nameFormat, string friendlyName)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The name format.

System.String friendlyName

The friendly name.

See Also
SAMLIdentifiers.AttributeNameFormats

AttributeType(String, String, String, String)

Initializes a new instance of the AttributeType class.

Declaration
public AttributeType(string name, string nameFormat, string friendlyName, string attributeValue)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The name format.

System.String friendlyName

The friendly name.

System.String attributeValue

The attribute value.

See Also
SAMLIdentifiers.AttributeNameFormats

AttributeType(String, String, String, String, Object)

Initializes a new instance of the AttributeType class.

Declaration
public AttributeType(string name, string nameFormat, string friendlyName, string attributeType, object attributeValue)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The name format.

System.String friendlyName

The friendly name.

System.String attributeType

The attribute type.

System.Object attributeValue

The attribute value.

See Also
SAMLIdentifiers.AttributeNameFormats
XmlSchema.SimpleTypes

AttributeType(String, String, String, String, String)

Initializes a new instance of the AttributeType class.

Declaration
public AttributeType(string name, string nameFormat, string friendlyName, string attributeType, string attributeValue)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The name format.

System.String friendlyName

The friendly name.

System.String attributeType

The attribute type.

System.String attributeValue

The attribute value.

See Also
SAMLIdentifiers.AttributeNameFormats
XmlSchema.SimpleTypes

AttributeType(XmlElement)

Initializes a new instance of the AttributeType class from XML.

Declaration
public AttributeType(XmlElement xmlElement)
Parameters
Type Name Description
System.Xml.XmlElement xmlElement

The attribute type XML.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

Properties

FriendlyName

Gets or sets the attribute's friendly name.

Declaration
public string FriendlyName { get; set; }
Property Value
Type Description
System.String

The attribute's friendly name.

Name

Gets or sets the attribute's name.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

The attribute's name.

NameFormat

Gets or sets the attribute's name format.

Declaration
public string NameFormat { get; set; }
Property Value
Type Description
System.String

The attribute's name format.

See Also
SAMLIdentifiers.AttributeNameFormats

Values

Gets or sets the attribute values.

Declaration
public IList<AttributeValue> Values { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<AttributeValue>

The attribute values.

See Also
AttributeValue

Methods

DeregisterAttributeValueSerializer(String, String)

Deregisters an attribute value serializer.

Declaration
public static void DeregisterAttributeValueSerializer(string name, string nameFormat)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The attribute name format.

See Also
RegisterAttributeValueSerializer(String, String, IAttributeValueSerializer)

GetAttributeValueSerializer(String, String)

Gets the attribute value serializer for the specified attribute name and name format.

Declaration
public static IAttributeValueSerializer GetAttributeValueSerializer(string name, string nameFormat)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The attribute name format.

Returns
Type Description
IAttributeValueSerializer

The attribute value serializer.

See Also
RegisterAttributeValueSerializer(String, String, IAttributeValueSerializer)

IsAttributeValueSerializerRegistered(String, String)

Indicates whether the attribute value serializer is registered.

Declaration
public static bool IsAttributeValueSerializerRegistered(string name, string nameFormat)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The attribute name format.

Returns
Type Description
System.Boolean

true if the attribute value serializer is registered; otherwise false.

See Also
RegisterAttributeValueSerializer(String, String, IAttributeValueSerializer)
DeregisterAttributeValueSerializer(String, String)

RegisterAttributeValueSerializer(String, String, IAttributeValueSerializer)

Registers an attribute value serializer for serializing attribute values to XML. Attribute value serializers are identified by attribute name and name format, both of which are optional.

If an attribute name and name format are specified then the serializer matches on both. If an attribute name is not specified then the serializer matches on attribute name format. If an attribute name format is not specified then the serializer matches on attribute name. If neither an attribute name nor name format are specified then the serializer matches all.

If there's no registered attribute value serializer then the default serializer is used and the attribute value is assumed to be a string.

Declaration
public static void RegisterAttributeValueSerializer(string name, string nameFormat, IAttributeValueSerializer attributeValueSerializer)
Parameters
Type Name Description
System.String name

The attribute name.

System.String nameFormat

The attribute name format.

IAttributeValueSerializer attributeValueSerializer

The attribute value serializer.

See Also
DeregisterAttributeValueSerializer(String, String)
StringAttributeValueSerializer
XmlAttributeValueSerializer

ToString()

Returns the attribute value data as a string.

Declaration
public override string ToString()
Returns
Type Description
System.String

The attribute value data as a string.

Overrides
System.Object.ToString()

ToString(String)

Returns the attribute value data as a string.

Declaration
public string ToString(string separator)
Parameters
Type Name Description
System.String separator

The separator to use between attribute values.

Returns
Type Description
System.String

The attribute value data as a string.

ToXml(XmlElement)

Serializes the attribute type to XML.

Declaration
public void ToXml(XmlElement xmlElement)
Parameters
Type Name Description
System.Xml.XmlElement xmlElement

The owning XML element.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML serialization fails.

In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2022. All rights reserved.