संपादित करें

इसके माध्यम से साझा किया गया


DynamicObject.TryDeleteMember(DeleteMemberBinder) Method

Definition

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

public:
 virtual bool TryDeleteMember(System::Dynamic::DeleteMemberBinder ^ binder);
public virtual bool TryDeleteMember (System.Dynamic.DeleteMemberBinder binder);
abstract member TryDeleteMember : System.Dynamic.DeleteMemberBinder -> bool
override this.TryDeleteMember : System.Dynamic.DeleteMemberBinder -> bool
Public Overridable Function TryDeleteMember (binder As DeleteMemberBinder) As Boolean

Parameters

binder
DeleteMemberBinder

Provides information about the deletion.

Returns

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.)

Remarks

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.

Applies to