DynamicObject.TryDeleteMember Method (DeleteMemberBinder)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Provides the implementation for operations that delete an object member. This method is not intended for use in C# or Visual Basic.

Namespace:   System.Dynamic
Assembly:  System.Core (in System.Core.dll)

abstract TryDeleteMember : 
        binder:DeleteMemberBinder -> bool
override TryDeleteMember : 
        binder:DeleteMemberBinder -> bool

Parameters

binder
Type: System.Dynamic.DeleteMemberBinder

Provides information about the deletion.

Return Value

Type: System.Boolean

true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.)

Classes derived from the DynamicObject class can override this method to specify how an object member should be deleted. When this method is not overridden, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.)

C# and Visual Basic compilers never emit code to use this method because they do not support this kind of operation. This method is intended for languages that support syntax for deleting members, such as del sampleObject.SampleMember in Python.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: