編輯

共用方式為


Errors.DeleteAll Method

Definition

Deletes all of the ErrorObject objects contained in the ErrorsCollection collection.

public:
 void DeleteAll();
public void DeleteAll ();
abstract member DeleteAll : unit -> unit
Public Sub DeleteAll ()

Examples

In the following example, the DeleteAll method of the ErrorsCollection collection is used to delete all the errors that it contains:

thisXDocument.Errors.<span class="label">DeleteAll</span>();

Remarks

To delete a specific Error object from the Errors collection, use the Delete method.

Note: Unlike the Delete(Object, String) method that will only delete errors that were created using the Add(Object, String, String, String, Int32, String) method, the DeleteAll method will delete all errors in the collection, regardless of how they were created.

Applies to