Export (0) Print
Expand All

DataFormats Class

Provides a set of predefined data format names that can be used to identify data formats available in the clipboard or drag-and-drop operations.

System.Object
  System.Windows.DataFormats

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

public static class DataFormats

The DataFormats type exposes the following members.

  NameDescription
Public methodStatic memberGetDataFormat(Int32)Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by numeric ID.
Public methodStatic memberGetDataFormat(String)Returns a DataFormat object that defines a name and numeric ID for the specified data format. The desired data format is specified by name (a string).
Top

  NameDescription
Public fieldStatic memberBitmapSpecifies a Microsoft Windows bitmap data format.
Public fieldStatic memberCommaSeparatedValueSpecifies a comma-separated value (CSV) data format.
Public fieldStatic memberDibSpecifies the device-independent bitmap (DIB) data format.
Public fieldStatic memberDifSpecifies the Windows Data Interchange Format (DIF) data format.
Public fieldStatic memberEnhancedMetafileSpecifies the Windows enhanced metafile format.
Public fieldStatic memberFileDropSpecifies the Windows file drop format.
Public fieldStatic memberHtmlSpecifies the HTML data format.
Public fieldStatic memberLocaleSpecifies the Windows locale (culture) data format.
Public fieldStatic memberMetafilePictureSpecifies the Windows metafile picture data format.
Public fieldStatic memberOemTextSpecifies the standard Windows OEM text data format.
Public fieldStatic memberPaletteSpecifies the Windows palette data format.
Public fieldStatic memberPenDataSpecifies the Windows pen data format.
Public fieldStatic memberRiffSpecifies the Resource Interchange File Format (RIFF) audio data format.
Public fieldStatic memberRtfSpecifies the Rich Text Format (RTF) data format.
Public fieldStatic memberSerializableSpecifies a data format that encapsulates any type of serializable data objects.
Public fieldStatic memberStringFormatSpecifies the common language runtime (CLR) string class data format.
Public fieldStatic memberSymbolicLinkSpecifies the Windows symbolic link data format.
Public fieldStatic memberTextSpecifies the ANSI text data format.
Public fieldStatic memberTiffSpecifies the Tagged Image File Format (TIFF) data format.
Public fieldStatic memberUnicodeTextSpecifies the Unicode text data format.
Public fieldStatic memberWaveAudioSpecifies the wave audio data format.
Public fieldStatic memberXamlSpecifies the Extensible Application Markup Language (XAML) data format.
Public fieldStatic memberXamlPackageSpecifies the Extensible Application Markup Language (XAML) package data format.
Top

The DataObject class and other classes that implement the IDataObject interface use the static formats defined by DataFormats to describe each data format that is stored in a data object. Data objects are typically used for transferring data to and from the system clipboard, and in drag-and-drop operations.

The following table lists the values of the static data format fields provided by DataFormats. These field values are provided for informational purposes only; in general, code should always refer to the appropriate field, rather than hard-coded strings.

Field

Field Value

Description

Bitmap

"Bitmap"

Specifies a Microsoft Windows bitmap data format.

CommaSeparatedValue

"CSV"

Specifies a comma-separated value (CSV) data format.

Dib

"DeviceIndependentBitmap"

Specifies the device-independent bitmap (DIB) data format.

Dif

"DataInterchangeFormat"

Specifies the Windows Data Interchange Format (DIF) data format.

EnhancedMetafile

"EnhancedMetafile"

Specifies the Windows enhanced metafile format.

FileDrop

"FileDrop"

Specifies the Windows file drop format.

Html

"HTML Format"

Specifies the HTML data format.

Locale

"Locale"

Specifies the Windows locale (culture) data format.

MetafilePicture

"MetaFilePict"

Specifies the Windows metafile picture data format.

OemText

"OEMText"

Specifies the standard Windows OEM text data format.

Palette

"Palette"

Specifies the Windows palette data format.

PenData

"PenData"

Specifies the Windows pen data format.

Riff

"RiffAudio"

Specifies the Resource Interchange File Format (RIFF) audio data format.

Rtf

"Rich Text Format"

Specifies the Rich Text Format (RTF) data format.

Serializable

"PersistentObject"

Specifies a data format that encapsulates any type of serializable data objects.

StringFormat

"System.String"

Specifies the common language runtime (CLR) string class data format.

SymbolicLink

"SymbolicLink"

Specifies the Windows symbolic link data format.

Text

"Text"

Specifies the ANSI text data format.

Tiff

"TaggedImageFileFormat"

Specifies the Tagged Image File Format (TIFF) data format.

UnicodeText

"UnicodeText"

Specifies the Unicode text data format.

WaveAudio

"WaveAudio"

Specifies the wave audio data format.

Xaml

"Xaml"

Specifies the Extensible Application Markup Language (XAML) data format.

XamlPackage

"XamlPackage"

Specifies the Extensible Application Markup Language (XAML) package data format.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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