Skip to content

IInfo Interface#

Provides access to the properties of an info object.

Syntax#

C#

public interface IInfo : IEnumerable<KeyValuePair<string, string>>

VB

Public Interface IInfo
    Inherits IEnumerable(Of KeyValuePair(Of String, String))

The IInfo type exposes the following members.

Properties#

NameDescription
Public propertyItem Retrieves the value of the specified property.
 

Methods#

NameDescription
Public methodContainsKey Indicates if the item has a specific property.
Public methodGetValueOrDefault Gets the property value if the given property key exists. Otherwise, returns the default value.
 

IInfo.ContainsKey Method#

Indicates if the item has a specific property.

Syntax#

C#

bool ContainsKey(
    string key
)

VB

Function ContainsKey ( 
    key As String
) As Boolean

Parameters#

 

key
Type: System.String
The key of the property to look up. The lookup is case sensitive.

Return Value#

Type: Boolean
Returns true if the property exists.

Remarks#

Thread Safety: This method is thread-safe.

Error Safety: Throws a System.ArgumentNullException if the key passed is null.

IInfo.GetValueOrDefault Method#

Gets the property value if the given property key exists. Otherwise, returns the default value.

Syntax#

C#

string GetValueOrDefault(
    string key,
    string defaultValue
)

VB

Function GetValueOrDefault ( 
    key As String,
    defaultValue As String
) As String

Parameters#

 

key
Type: System.String
The key of the property to look up. The lookup is case sensitive.
defaultValue
Type: System.String
The default value returned if the property key is not found.

Return Value#

Type: String
Returns the property value if the given property key exists. Otherwise, returns the default value.

Remarks#

Thread Safety: This method is thread-safe.

Error Safety: Throws a System.ArgumentNullException if the key passed is null.

IInfo.Item Property#

Retrieves the value of the specified property.

Syntax#

C#

string this[
    string key
] { get; }

VB

ReadOnly Default Property Item ( 
    key As String
) As String
    Get

Parameters#

 

key
Type: System.String
The key of the property to look up. The lookup is case sensitive.

Return Value#

Type: String
Returns the value of the property.

Remarks#

Thread Safety: This method is thread-safe.

Error Safety: Throws a System.ArgumentNullException if the key passed is null. Throws a System.NotSupportedException if the key passed does not exist in the info object.