IWMSPlugin.Enabled (C#)

The Enabled property specifies and retrieves a Boolean value indicating whether the plug-in is enabled.

Plugin.Enabled = bool;
bool = Plugin.Enabled;

Property Value

A bool indicating whether the plug-in is enabled. By default, this parameter is false.

If this property fails, it throws an exception.

Number

Description

0x0000052E

This value can be returned by the WMS Anonymous User Authentication plug-in to indicate that the user name or password set through its custom administration interface does not match the settings for the Windows user account that is used for anonymous guests.

0xC00D1454L

The plug-in does not support loading as either an in-process or an out-of-process component.

0xC00D157CL

This value can be returned by the WMS Active Script Event Handler plug-in to indicate that it was unable to find a script engine to run the script indicated by its FileName property.

0xC00D1457L

The plug-in cannot be enabled or disabled while the publishing point is running.

0xC00D1456L

Only one multicast data writer plug-in can be enabled on a publishing point.

Remarks

When you call the Enabled property, the server will load the plug-in if it is not already loaded. Because the Enabled property is persistent, it may not reflect the current status of the plug-in if the status changes after Enabled is called. Use the IWMSPlugin.Status property to retrieve the plug-in status.

Example

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlugins        Plugins;
IWMSPlugin         Plugin;

bool               bEnabled;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators;

    // Retrieve information about each plug-in.
    for (int i = 0; i < Plugins.Count; i++)
    {
        Plugin = Plugins[i];

        // Retrieve a Boolean value indicating whether
        // the plug-in is enabled.
        bEnabled = Plugin.Enabled;

        // Set a Boolean value indicating that
        // the plug-in is enabled.
        Plugin.Enabled = true;
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Reference

IWMSPlugin Object (C#)

IWMSPlugin.Enabled (C#)

IWMSPlugin.Status (C#)

IWMSPlugins Object (C#)