WMEncoder.Attributes

Windows Media Encoder SDK banner art

The Attributes property retrieves a collection of user-defined name-value pairs.

Syntax

IWMEncAttributes = WMEncoder.Attributes;

Parameters

This property takes no parameters.

Property Value

An IWMEncAttributes object containing a collection of attributes.

Remarks

Attributes are name-value pairs representing extra information about the output of the encoding session. They are defined by the author and stored in an attributes collection. Both the name and the value are String types.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();

// Retrieve an IWMEncAttributes object.
IWMEncAttributes Attr;
Attr = Encoder.Attributes;
int i;
string sName;
string sValue;

// Add three custom attributes to the collection.
Attr.Add("Date created: ", "02/15/2000");
Attr.Add("Time created: ", "13:30:15");
Attr.Add("File content: ", "multimedia data");

// View the attributes in the collection.
for (i = 0; i < Attr.Count; i++)
{
  sValue = Attr.Item(i, sName);
}

// Remove an attribute by name.
Attr.Remove("File content: ");

// Remove an attribute by index.
Attr.Remove(0);

// Remove any remaining attributes.
Attr.RemoveAll();
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also