DWMSNamedValuesEvents.OnValueChanged (Visual Basic .NET)

The OnValueChanged event specifies an event handler for event notices raised by the server when a property on your plug-in is added, removed, or modified.

Dim WithEvents m_NamedValues As WMSNamedValues


When the Microsoft.WindowsMediaServices.Interop assembly is created, a number of objects are automatically generated to wrap low-level COM connection point architecture implemented by the server in the WMSNamedValues class. For example, you can use the DWMSNamedValuesEvents_OnValueChangedEventHandler object to specify a handler for changes to plug-in properties. You must create the event handler inside of the plug-in. The server raises event notices when your plug-in calls any of the following properties and methods:

  • IWMSNamedValue.Value

  • IWMSNamedValues.Add

  • IWMSNamedValues.Remove

  • IWMSNamedValues.Item

You typically initialize plug-in properties when you register a plug-in, but you can add, remove, or modify them after they are initialized. Common properties include copyright information, the name of the author, descriptive text about the plug-in, property page monikers, and more. For more information, see Registering Plug-in Properties.

You cannot handle changes to properties made by using the server object model outside of your plug-in. The event sink can only handle changes made by your plug-in.


The IWMSBasicPlugin.InitializePlugin method sends a WMSNamedValues object to your plug-in. You can use this object to receive the OnValueChanged event.

Protected WithEvents m_NamedValues As WMSNamedValues

Public Overloads Sub InitializePlugin( _
    ByVal ServerContext As IWMSContext, _
    ByVal NamedValues As WMSNamedValues, _
    ByVal ClassFactory As IWMSClassObject) _
    Implements IWMSBasicPlugin.InitializePlugin

    m_NamedValues = NamedValues
End Sub

The event handler is a separate function that is called by the .NET runtime when the server raises an appropriate event.

Private Sub m_NamedValues_OnValueChanged() _
    Handles m_NamedValues.OnValueChanged

    ' TODO: Handle the event notice.
End Sub


Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also


IWMSNamedValue Object (Visual Basic .NET)

IWMSNamedValues Object (Visual Basic .NET)


DWMSNamedValuesEvents Object (Visual Basic .NET)