DataFormats.Dif Pole

Definice

Určuje Windows formát DIF (Data Interchange Format), který model Windows Forms přímo nepoužívá. Toto static pole je jen pro čtení.

public: static initonly System::String ^ Dif;
public static readonly string Dif;
 staticval mutable Dif : string
Public Shared ReadOnly Dif As String 

Hodnota pole

String

Příklady

Následující příklad kódu ukazuje použití tohoto člena.

FileStream^ myFileStream = File::Open( "Temp.dif", FileMode::Open );

// Store the data into Dif format.
DataObject^ myDataObject = gcnew DataObject;
myDataObject->SetData( DataFormats::Dif, myFileStream );

// Check whether the data is stored or not in the specified format.
bool formatPresent = myDataObject->GetDataPresent( DataFormats::Dif );
if ( formatPresent )
{
   Console::WriteLine( "The data has been stored in the Dif format is:'{0}'", formatPresent );
}
else
{
   Console::WriteLine( "The data has not been stored in the specified format" );
}
 FileStream myFileStream = File.Open("Temp.dif",FileMode.Open);
 // Store the data into Dif format.
 DataObject myDataObject = new DataObject();
 myDataObject.SetData(DataFormats.Dif,myFileStream);

// Check whether the data is stored or not in the specified format.
bool formatPresent = myDataObject.GetDataPresent(DataFormats.Dif);
 if(formatPresent) 
 {
    Console.WriteLine("The data has been stored in the Dif format is:'"+formatPresent+"'");
 } 
 else 
 {
    Console.WriteLine("The data has not been stored in the specified format");
 }
Dim myFileStream As FileStream = File.Open("Temp.dif", FileMode.Open)
' Store the data into Dif format.
Dim myDataObject As New DataObject()
myDataObject.SetData(DataFormats.Dif, myFileStream)

' Check whether the data is stored or not in the specified format.
Dim formatPresent As Boolean = myDataObject.GetDataPresent(DataFormats.Dif)
If formatPresent Then
   Console.WriteLine(("The data has been stored in the Dif format is:'" + formatPresent.ToString() + "'"))
Else
   Console.WriteLine("The data has not been stored in the specified format")
End If

Poznámky

DIF je formát skládající se z kódů ASCII, ve kterých může být databáze, tabulka a podobné dokumenty strukturovány, aby usnadnily jejich použití a přenos do jiných programů.

Toto pole používá IDataObject rozhraní a DataObject třída k určení datového typu.

Při přidávání do IDataObject nebo k implementaci DataObjecttohoto pole použijte toto pole jako formát pro metody IDataObject.SetData a DataObject.SetData metody.

Chcete-li zjistit, zda objekt tohoto typu existuje, použijte toto pole jako formát pro metody IDataObject.GetDataPresent a DataObject.GetDataPresent metody.

Chcete-li získat objekt tohoto typu, použijte ho jako formát pro metody IDataObject.GetData a DataObject.GetData metody.

Platí pro

Viz také