245 references to DataFormats
PresentationCore (135)
Core\CSharp\MS\Internal\ConstrainedDataObject.cs (2)
318
return (IsFormatEqual(format,
DataFormats
.Xaml) ||
319
IsFormatEqual(format,
DataFormats
.ApplicationTrust));
Core\CSharp\System\Windows\Clipboard.cs (24)
94
return ContainsDataInternal(
DataFormats
.WaveAudio);
120
return ContainsDataInternal(
DataFormats
.FileDrop);
128
return ContainsDataInternal(
DataFormats
.Bitmap);
137
return ContainsDataInternal(
DataFormats
.UnicodeText);
146
if (!
DataFormats
.IsValidTextDataFormat(format))
151
return ContainsDataInternal(
DataFormats
.ConvertToDataFormats(format));
187
return GetDataInternal(
DataFormats
.WaveAudio) as Stream;
218
fileDropList = GetDataInternal(
DataFormats
.FileDrop) as string[];
232
return GetDataInternal(
DataFormats
.Bitmap) as BitmapSource;
248
if (!
DataFormats
.IsValidTextDataFormat(format))
255
text = (string)GetDataInternal(
DataFormats
.ConvertToDataFormats(format));
288
SetDataInternal(
DataFormats
.WaveAudio, audioStream);
346
SetDataInternal(
DataFormats
.FileDrop, fileDropListStrings);
359
SetDataInternal(
DataFormats
.Bitmap, image);
385
if (!
DataFormats
.IsValidTextDataFormat(format))
390
SetDataInternal(
DataFormats
.ConvertToDataFormats(format), text);
714
isApplicationTrustFormatPresent = dataObjectToApply.GetDataPresent(
DataFormats
.ApplicationTrust, /*autoConvert:*/false);
717
applicationTrust = dataObjectToApply.GetData(
DataFormats
.ApplicationTrust, /*autoConvert:*/false);
809
(dataObject.GetDataPresent(
DataFormats
.Xaml, /*autoConvert:*/false) ||
810
dataObject.GetDataPresent(
DataFormats
.ApplicationTrust, /*autoConvert:*/false)))
840
if (SafeNativeMethods.IsClipboardFormatAvailable(
DataFormats
.GetDataFormat(formats[i]).Id))
849
isFormatAvailable = SafeNativeMethods.IsClipboardFormatAvailable(
DataFormats
.GetDataFormat(format).Id);
915
if (String.CompareOrdinal(format,
DataFormats
.FileDrop) == 0 ||
916
String.CompareOrdinal(format,
DataFormats
.Bitmap) == 0)
Core\CSharp\System\Windows\DataFormats.cs (8)
312
string dataFormat =
DataFormats
.UnicodeText;
317
dataFormat =
DataFormats
.Text;
321
dataFormat =
DataFormats
.UnicodeText;
325
dataFormat =
DataFormats
.Rtf;
329
dataFormat =
DataFormats
.Html;
333
dataFormat =
DataFormats
.CommaSeparatedValue;
337
dataFormat =
DataFormats
.Xaml;
470
int applicationTrustFormatId = UnsafeNativeMethods.RegisterClipboardFormat(
DataFormats
.ApplicationTrust);
Core\CSharp\System\Windows\DataObject.cs (101)
478
return GetDataPresent(
DataFormats
.WaveAudio, /*autoConvert*/false);
486
return GetDataPresent(
DataFormats
.FileDrop, /*autoConvert*/false);
494
return GetDataPresent(
DataFormats
.Bitmap, /*autoConvert*/false);
510
if (!
DataFormats
.IsValidTextDataFormat(format))
515
return GetDataPresent(
DataFormats
.ConvertToDataFormats(format), /*autoConvert*/false);
523
return GetData(
DataFormats
.WaveAudio, /*autoConvert*/false) as Stream;
536
fileDropList = GetData(
DataFormats
.FileDrop, /*autoConvert*/true) as string[];
550
return GetData(
DataFormats
.Bitmap, /*autoConvert*/true) as BitmapSource;
566
if (!
DataFormats
.IsValidTextDataFormat(format))
573
text = (string)GetData(
DataFormats
.ConvertToDataFormats(format), false);
606
SetData(
DataFormats
.WaveAudio, audioStream, /*autoConvert*/false);
641
SetData(
DataFormats
.FileDrop, fileDropListStrings, /*audoConvert*/true);
654
SetData(
DataFormats
.Bitmap, image, /*audoConvert*/true);
680
if (!
DataFormats
.IsValidTextDataFormat(format))
685
SetData(
DataFormats
.ConvertToDataFormats(format), textData, /*audoConvert*/false);
926
if (!GetDataPresent(
DataFormats
.GetDataFormat(formatetc.cfFormat).Name))
1433
if (IsFormatEqual(format,
DataFormats
.Text)
1434
|| IsFormatEqual(format,
DataFormats
.UnicodeText)
1435
|| IsFormatEqual(format,
DataFormats
.StringFormat))
1445
DataFormats
.Text,
1446
DataFormats
.UnicodeText,
1447
DataFormats
.StringFormat,
1453
DataFormats
.Text,
1454
DataFormats
.UnicodeText,
1460
if (IsFormatEqual(format,
DataFormats
.FileDrop)
1461
|| IsFormatEqual(format,
DataFormats
.FileName)
1462
|| IsFormatEqual(format,
DataFormats
.FileNameW))
1466
DataFormats
.FileDrop,
1467
DataFormats
.FileNameW,
1468
DataFormats
.FileName,
1474
if (IsFormatEqual(format,
DataFormats
.Bitmap)
1480
DataFormats
.Bitmap,
1487
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile)
1491
DataFormats
.EnhancedMetafile,
1675
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
1729
format =
DataFormats
.GetDataFormat(formatetc.cfFormat).Name;
1783
else if (IsFormatEqual(format,
DataFormats
.Html)
1784
|| IsFormatEqual(format,
DataFormats
.Xaml))
1789
else if (IsFormatEqual(format,
DataFormats
.Text)
1790
|| IsFormatEqual(format,
DataFormats
.Rtf)
1791
|| IsFormatEqual(format,
DataFormats
.OemText)
1792
|| IsFormatEqual(format,
DataFormats
.CommaSeparatedValue))
1796
else if (IsFormatEqual(format,
DataFormats
.UnicodeText)||
1797
IsFormatEqual(format,
DataFormats
.ApplicationTrust))
1801
else if (IsFormatEqual(format,
DataFormats
.FileDrop))
1805
else if (IsFormatEqual(format,
DataFormats
.FileName))
1812
else if (IsFormatEqual(format,
DataFormats
.FileNameW))
1819
else if (IsFormatEqual(format,
DataFormats
.Dib)
1838
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile)
1845
else if (IsFormatEqual(format,
DataFormats
.Serializable)
1930
if (IsFormatEqual(format,
DataFormats
.Bitmap)
1969
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
2420
(IsFormatEqual(format,
DataFormats
.Serializable)
2433
return (!IsFormatEqual(format,
DataFormats
.Text)
2434
&& !IsFormatEqual(format,
DataFormats
.OemText)
2435
&& !IsFormatEqual(format,
DataFormats
.UnicodeText)
2436
&& !IsFormatEqual(format,
DataFormats
.CommaSeparatedValue)
2437
&& !IsFormatEqual(format,
DataFormats
.Xaml)
2438
&& !IsFormatEqual(format,
DataFormats
.ApplicationTrust));
2529
(IsFormatEqual(format,
DataFormats
.Bitmap) || IsFormatEqual(format, SystemBitmapSourceFormat)))
2636
temp.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
2641
if (IsFormatEqual(format,
DataFormats
.Bitmap))
2645
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
2818
SetData(
DataFormats
.Serializable, data);
2862
name =
DataFormats
.GetDataFormat(formatetc[0].cfFormat).Name;
3075
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
3154
if (IsFormatEqual(format,
DataFormats
.Html)
3155
|| IsFormatEqual(format,
DataFormats
.Xaml))
3162
else if (IsFormatEqual(format,
DataFormats
.Text)
3163
|| IsFormatEqual(format,
DataFormats
.Rtf)
3164
|| IsFormatEqual(format,
DataFormats
.OemText)
3165
|| IsFormatEqual(format,
DataFormats
.CommaSeparatedValue))
3169
else if (IsFormatEqual(format,
DataFormats
.UnicodeText) ||
3170
IsFormatEqual(format,
DataFormats
.ApplicationTrust))
3174
else if (IsFormatEqual(format,
DataFormats
.FileDrop))
3179
else if (IsFormatEqual(format,
DataFormats
.FileName))
3184
else if (IsFormatEqual(format,
DataFormats
.FileNameW))
3202
(IsFormatEqual(format,
DataFormats
.StringFormat) ||
3203
IsFormatEqual(format,
DataFormats
.Dib) ||
3204
IsFormatEqual(format,
DataFormats
.Bitmap) ||
3205
IsFormatEqual(format,
DataFormats
.EnhancedMetafile) ||
3206
IsFormatEqual(format,
DataFormats
.MetafilePicture) ||
3207
IsFormatEqual(format,
DataFormats
.SymbolicLink) ||
3208
IsFormatEqual(format,
DataFormats
.Dif) ||
3209
IsFormatEqual(format,
DataFormats
.Tiff) ||
3210
IsFormatEqual(format,
DataFormats
.Palette) ||
3211
IsFormatEqual(format,
DataFormats
.PenData) ||
3212
IsFormatEqual(format,
DataFormats
.Riff) ||
3213
IsFormatEqual(format,
DataFormats
.WaveAudio) ||
3214
IsFormatEqual(format,
DataFormats
.Locale));
3243
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
3291
if (IsFormatEqual(format,
DataFormats
.Bitmap))
3295
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
3305
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
3320
if (IsFormatEqual(format,
DataFormats
.Bitmap))
3326
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
3637
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
3933
&& !this._data.ContainsKey(
DataFormats
.Serializable))
3936
SetData(
DataFormats
.Serializable, data);
3958
if (IsFormatEqual(format,
DataFormats
.Dib))
3962
format =
DataFormats
.Bitmap;
PresentationFramework (109)
src\Framework\MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (14)
220
rtbRange.Save(buffer,
DataFormats
.Xaml);
246
rtbRange.Load(buffer,
DataFormats
.Xaml);
304
if (e.FormatToApply ==
DataFormats
.Rtf)
309
String rtfString = e.DataObject.GetData(
DataFormats
.Rtf) as String;
313
range.Load(data,
DataFormats
.Rtf);
317
range.Save(buffer,
DataFormats
.Xaml);
319
dataObject.SetData(
DataFormats
.Xaml, encoding.GetString(buffer.GetBuffer()));
321
e.FormatToApply =
DataFormats
.Xaml;
323
else if (e.FormatToApply ==
DataFormats
.Bitmap ||
324
e.FormatToApply ==
DataFormats
.EnhancedMetafile ||
325
e.FormatToApply ==
DataFormats
.MetafilePicture ||
326
e.FormatToApply ==
DataFormats
.Tiff)
331
else if (e.FormatToApply ==
DataFormats
.XamlPackage)
334
e.FormatToApply =
DataFormats
.Xaml;
src\Framework\MS\Internal\Ink\TextClipboardData.cs (6)
52
return ( dataObject.GetDataPresent(
DataFormats
.UnicodeText, false)
53
|| dataObject.GetDataPresent(
DataFormats
.Text, false)
54
|| dataObject.GetDataPresent(
DataFormats
.OemText, false) );
75
dataObject.SetData(
DataFormats
.UnicodeText, _text, true);
85
string text = dataObject.GetData(
DataFormats
.UnicodeText, true) as string;
90
text = dataObject.GetData(
DataFormats
.Text, true) as string;
src\Framework\MS\Internal\Ink\XamlClipboardData.cs (4)
56
hasXamlData = dataObject.GetDataPresent(
DataFormats
.Xaml, false);
114
dataObject.SetData(
DataFormats
.Xaml, xmlData.ToString());
123
dataObject.SetData(
DataFormats
.ApplicationTrust, setString);
133
string xml = dataObject.GetData(
DataFormats
.Xaml) as string;
src\Framework\System\Windows\Controls\DataGrid.cs (5)
8292
Collection<string> formats = new Collection<string>(new string[] {
DataFormats
.Html,
DataFormats
.Text,
DataFormats
.UnicodeText,
DataFormats
.CommaSeparatedValue });
8338
DataGridClipboardHelper.GetClipboardContentForHtml(dataGridStringBuilders[
DataFormats
.Html]);
src\Framework\System\Windows\Controls\DataGridClipboardHelper.cs (4)
24
bool csv = string.Equals(format,
DataFormats
.CommaSeparatedValue, StringComparison.OrdinalIgnoreCase);
25
if (csv || string.Equals(format,
DataFormats
.Text, StringComparison.OrdinalIgnoreCase)
26
|| string.Equals(format,
DataFormats
.UnicodeText, StringComparison.OrdinalIgnoreCase))
50
else if (string.Equals(format,
DataFormats
.Html, StringComparison.OrdinalIgnoreCase))
src\Framework\System\Windows\Documents\RubberbandSelector.cs (3)
247
dataObject.SetData(
DataFormats
.Text, textString, true);
248
dataObject.SetData(
DataFormats
.UnicodeText, textString, true);
251
dataObject.SetData(
DataFormats
.Bitmap, bmp, true);
src\Framework\System\windows\Documents\TextEditorCopyPaste.cs (57)
122
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Text))
124
CriticalSetDataWrapper(dataObject,
DataFormats
.Text, textString);
129
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.UnicodeText))
131
CriticalSetDataWrapper(dataObject,
DataFormats
.UnicodeText, textString);
157
if (wpfContainerMemory != null && ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.XamlPackage))
159
dataObject.SetData(
DataFormats
.XamlPackage, wpfContainerMemory);
163
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Rtf))
170
dataObject.SetData(
DataFormats
.Rtf, rtfText, true);
194
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Xaml))
197
CriticalSetDataWrapper(dataObject,
DataFormats
.Xaml, xamlText);
205
CriticalSetDataWrapper(dataObject,
DataFormats
.ApplicationTrust, permissionSetCurrentAppDomain);
305
if (This.AcceptsRichContent && hasUnmanagedCodePermission && dataObject.GetDataPresent(
DataFormats
.XamlPackage))
307
formatToApply =
DataFormats
.XamlPackage;
309
else if (This.AcceptsRichContent && dataObject.GetDataPresent(
DataFormats
.Xaml))
311
formatToApply =
DataFormats
.Xaml;
313
else if (This.AcceptsRichContent && hasUnmanagedCodePermission && dataObject.GetDataPresent(
DataFormats
.Rtf))
315
formatToApply =
DataFormats
.Rtf;
317
else if (dataObject.GetDataPresent(
DataFormats
.UnicodeText))
319
formatToApply =
DataFormats
.UnicodeText;
321
else if (dataObject.GetDataPresent(
DataFormats
.Text))
323
formatToApply =
DataFormats
.Text;
327
formatToApply =
DataFormats
.Bitmap;
822
((DataObject)dataObjectValue).CriticalSetData(format, content, format ==
DataFormats
.ApplicationTrust ? /*autoConvert:*/false : true);
851
if (formatToApply ==
DataFormats
.Bitmap && dataObjectToApply is DataObject)
860
System.Windows.Media.Imaging.BitmapSource bitmapSource = GetPasteData(dataObjectToApply,
DataFormats
.Bitmap) as System.Windows.Media.Imaging.BitmapSource;
869
formatToApply =
DataFormats
.XamlPackage;
870
dataObjectToApply.SetData(
DataFormats
.XamlPackage, packagedImage);
875
if (formatToApply ==
DataFormats
.XamlPackage)
884
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.XamlPackage);
904
if (dataObjectToApply.GetDataPresent(
DataFormats
.Xaml))
906
formatToApply =
DataFormats
.Xaml;
908
else if (SecurityHelper.CheckUnmanagedCodePermission() && dataObjectToApply.GetDataPresent(
DataFormats
.Rtf))
910
formatToApply =
DataFormats
.Rtf;
912
else if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
914
formatToApply =
DataFormats
.UnicodeText;
916
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
918
formatToApply =
DataFormats
.Text;
922
if (formatToApply ==
DataFormats
.Xaml)
926
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Xaml);
936
if (SecurityHelper.CheckUnmanagedCodePermission() && dataObjectToApply.GetDataPresent(
DataFormats
.Rtf))
938
formatToApply =
DataFormats
.Rtf;
940
else if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
942
formatToApply =
DataFormats
.UnicodeText;
944
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
946
formatToApply =
DataFormats
.Text;
950
if (formatToApply ==
DataFormats
.Rtf)
958
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Rtf);
977
if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
979
formatToApply =
DataFormats
.UnicodeText;
981
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
983
formatToApply =
DataFormats
.Text;
987
if (formatToApply ==
DataFormats
.UnicodeText)
989
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.UnicodeText);
992
if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
994
formatToApply =
DataFormats
.Text; // fall to plain text
1007
if (formatToApply ==
DataFormats
.Text)
1009
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Text);
src\Framework\System\Windows\Documents\TextRangeBase.cs (16)
1491
dataFormat ==
DataFormats
.Text ||
1492
dataFormat ==
DataFormats
.Xaml ||
1494
dataFormat ==
DataFormats
.XamlPackage ||
1495
dataFormat ==
DataFormats
.Rtf)));
1505
dataFormat ==
DataFormats
.Text ||
1506
dataFormat ==
DataFormats
.Xaml ||
1508
dataFormat ==
DataFormats
.XamlPackage ||
1509
dataFormat ==
DataFormats
.Rtf)));
1527
if (dataFormat ==
DataFormats
.Text)
1534
else if (dataFormat ==
DataFormats
.Xaml)
1543
else if (dataFormat ==
DataFormats
.XamlPackage && SecurityHelper.CheckUnmanagedCodePermission())
1549
else if (dataFormat ==
DataFormats
.Rtf && SecurityHelper.CheckUnmanagedCodePermission())
1587
if (dataFormat ==
DataFormats
.Text)
1593
else if (dataFormat ==
DataFormats
.Xaml)
1599
else if (dataFormat ==
DataFormats
.XamlPackage && SecurityHelper.CheckUnmanagedCodePermission())
1608
else if (dataFormat ==
DataFormats
.Rtf && SecurityHelper.CheckUnmanagedCodePermission())
System.Activities.Presentation (1)
System.Activities.Presentation\System\Activities\Presentation\CutCopyPasteHelper.cs (1)
550
dataObject.SetData(
DataFormats
.Text, clipBoardString);