* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
2.6 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| How to: Determine if a Data Format is Present in a Data Object | 03/30/2017 |
|
|
e487a454-c9fc-4e53-aeaa-c458d059ad4c |
How to: Determine if a Data Format is Present in a Data Object
The following examples show how to use the various xref:System.Windows.DataObject.GetDataPresent%2A method overloads to query whether a particular data format is present in a data object.
Example
Description
The following example code uses the xref:System.Windows.DataObject.GetDataPresent%28System.String%29 overload to query for the presence of a particular data format by descriptor string.
Code
[!code-csharpDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_String] [!code-vbDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_String]
Example
Description
The following example code uses the xref:System.Windows.DataObject.GetDataPresent%28System.Type%29 overload to query for the presence of a particular data format by type.
Code
[!code-csharpDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Type] [!code-vbDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Type]
Example
Description
The following example code uses the xref:System.Windows.DataObject.GetDataPresent%28System.String%2CSystem.Boolean%29 overload to query for data by descriptor string, and specifying how to treat auto-convertible data formats.
Code
[!code-csharpDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Autoconvert] [!code-vbDragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Autoconvert]