IWMSPlugins.Clone (C#)
Previous | Next |
IWMSPlugins.Clone (C#)
The Clone method creates a duplicate instance of a specific IWMSPlugin object.
Syntax
IWMSPlugin = IWMSPlugins.Clone( string strDestName, IWMSPlugin SrcPlugin );
Parameters
strDestName
[in] string containing the name of the plug-in to create.
SrcPlugin
[in] IWMSPlugin object to clone.
Return Values
This method returns an IWMSPlugin object.
If this method fails, it throws an exception.
Number | Description |
0xC00D0036L | strDestName is already being used by another plug-in in the current plug-in collection. |
0xC00D1396L | strDestName contains an invalid character. Invalid characters are: & " ' < > \ |
0xC00D1394L | strDestName is a zero-length string. |
0xC00D1392L | strDestName is longer than the maximum allowed length. |
Remarks
All property values are copied to the new plug-in except the Enabled property, which is set to false.
The WMS_PLUGIN_REMOVE_ON_SERVICE_RESTART flag for the duplicate plug-in is set to false. The value for this flag is accessible from the IWMSPlugin.Status method.
Example Code
using Microsoft.WindowsMediaServices.Interop; using System.Runtime.InteropServices; // Declare variables. WMSServer Server; IWMSPlugins Plugins; IWMSPlugin Plugin; IWMSPlugin PluginClone; string strText; 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]; // Clone the plug-in. strText = "Cloned Plugin"; PluginClone = Plugins.Clone(strText, Plugin); } } 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
Previous | Next |