Export (0) Print
Expand All

DeleteOptions Class

Specifies options for deleting a management object.

For a list of all members of this type, see DeleteOptions Members.

System.Object
   System.Management.ManagementOptions
      System.Management.DeleteOptions

[Visual Basic]
Public Class DeleteOptions
   Inherits ManagementOptions
[C#]
public class DeleteOptions : ManagementOptions
[C++]
public __gc class DeleteOptions : public ManagementOptions
[JScript]
public class DeleteOptions extends ManagementOptions

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Example

[C#] 
using System;
using System.Management;

// This example demonstrates how to specify a timeout value
// when deleting a ManagementClass object.
class Sample_DeleteOptions
{
    public static int Main(string[] args) {
        ManagementClass newClass = new ManagementClass();
        newClass["__CLASS"] = "ClassToDelete";
        newClass.Put();
   
        // Set deletion options: delete operation timeout value
        DeleteOptions opt = new DeleteOptions(null, new TimeSpan(0,0,0,5));
        
        ManagementClass dummyClassToDelete =
            new ManagementClass("ClassToDelete");
        dummyClassToDelete.Delete(opt);

        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates how to specify a timeout value
' when deleting a ManagementClass object.
Class Sample_DeleteOptions
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim newClass As New ManagementClass()
        newClass("__CLASS") = "ClassToDelete"
        newClass.Put()

        ' Set deletion options: delete operation timeout value
        Dim opt As New DeleteOptions(Nothing, New TimeSpan(0, 0, 0, 5))
        
        Dim dummyClassToDelete As New ManagementClass("ClassToDelete")
        dummyClassToDelete.Delete(opt)
        Return 0
    End Function
End Class
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Management

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Management (in System.Management.dll)

See Also

DeleteOptions Members | System.Management Namespace

Show:
© 2014 Microsoft