231 references to DataFormats
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
InteractivePaste\InteractivePasteCommandHandlerTests.vb (2)
235
data.SetData(
DataFormats
.UnicodeText, text)
236
data.SetData(
DataFormats
.StringFormat, text)
PresentationCore (121)
System\Windows\clipboard.cs (20)
81
return ContainsDataInternal(
DataFormats
.WaveAudio);
104
return ContainsDataInternal(
DataFormats
.FileDrop);
112
return ContainsDataInternal(
DataFormats
.Bitmap);
121
return ContainsDataInternal(
DataFormats
.UnicodeText);
130
if (!
DataFormats
.IsValidTextDataFormat(format))
135
return ContainsDataInternal(
DataFormats
.ConvertToDataFormats(format));
170
return GetDataInternal(
DataFormats
.WaveAudio) as Stream;
198
fileDropList = GetDataInternal(
DataFormats
.FileDrop) as string[];
212
return GetDataInternal(
DataFormats
.Bitmap) as BitmapSource;
228
if (!
DataFormats
.IsValidTextDataFormat(format))
235
text = (string)GetDataInternal(
DataFormats
.ConvertToDataFormats(format));
262
SetDataInternal(
DataFormats
.WaveAudio, audioStream);
311
SetDataInternal(
DataFormats
.FileDrop, fileDropListStrings);
321
SetDataInternal(
DataFormats
.Bitmap, image);
341
if (!
DataFormats
.IsValidTextDataFormat(format))
346
SetDataInternal(
DataFormats
.ConvertToDataFormats(format), text);
648
if (SafeNativeMethods.IsClipboardFormatAvailable(
DataFormats
.GetDataFormat(formats[i]).Id))
657
isFormatAvailable = SafeNativeMethods.IsClipboardFormatAvailable(
DataFormats
.GetDataFormat(format).Id);
723
if (string.Equals(format,
DataFormats
.FileDrop, StringComparison.Ordinal) ||
724
string.Equals(format,
DataFormats
.Bitmap, StringComparison.Ordinal))
System\Windows\DataFormats.cs (8)
294
string dataFormat =
DataFormats
.UnicodeText;
299
dataFormat =
DataFormats
.Text;
303
dataFormat =
DataFormats
.UnicodeText;
307
dataFormat =
DataFormats
.Rtf;
311
dataFormat =
DataFormats
.Html;
315
dataFormat =
DataFormats
.CommaSeparatedValue;
319
dataFormat =
DataFormats
.Xaml;
439
int applicationTrustFormatId = UnsafeNativeMethods.RegisterClipboardFormat(
DataFormats
.ApplicationTrust);
System\Windows\dataobject.cs (93)
354
return GetDataPresent(
DataFormats
.WaveAudio, /*autoConvert*/false);
362
return GetDataPresent(
DataFormats
.FileDrop, /*autoConvert*/false);
370
return GetDataPresent(
DataFormats
.Bitmap, /*autoConvert*/false);
386
if (!
DataFormats
.IsValidTextDataFormat(format))
391
return GetDataPresent(
DataFormats
.ConvertToDataFormats(format), /*autoConvert*/false);
399
return GetData(
DataFormats
.WaveAudio, /*autoConvert*/false) as Stream;
412
fileDropList = GetData(
DataFormats
.FileDrop, /*autoConvert*/true) as string[];
426
return GetData(
DataFormats
.Bitmap, /*autoConvert*/true) as BitmapSource;
442
if (!
DataFormats
.IsValidTextDataFormat(format))
449
text = (string)GetData(
DataFormats
.ConvertToDataFormats(format), false);
476
SetData(
DataFormats
.WaveAudio, audioStream, /*autoConvert*/false);
508
SetData(
DataFormats
.FileDrop, fileDropListStrings, /*audoConvert*/true);
518
SetData(
DataFormats
.Bitmap, image, /*audoConvert*/true);
538
if (!
DataFormats
.IsValidTextDataFormat(format))
543
SetData(
DataFormats
.ConvertToDataFormats(format), textData, /*audoConvert*/false);
744
if (!GetDataPresent(
DataFormats
.GetDataFormat(formatetc.cfFormat).Name))
1181
if (IsFormatEqual(format,
DataFormats
.Text)
1182
|| IsFormatEqual(format,
DataFormats
.UnicodeText)
1183
|| IsFormatEqual(format,
DataFormats
.StringFormat))
1188
DataFormats
.Text,
1189
DataFormats
.UnicodeText,
1190
DataFormats
.StringFormat,
1196
if (IsFormatEqual(format,
DataFormats
.FileDrop)
1197
|| IsFormatEqual(format,
DataFormats
.FileName)
1198
|| IsFormatEqual(format,
DataFormats
.FileNameW))
1201
DataFormats
.FileDrop,
1202
DataFormats
.FileNameW,
1203
DataFormats
.FileName,
1209
if (IsFormatEqual(format,
DataFormats
.Bitmap)
1215
DataFormats
.Bitmap,
1222
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile)
1226
DataFormats
.EnhancedMetafile,
1380
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
1429
format =
DataFormats
.GetDataFormat(formatetc.cfFormat).Name;
1478
else if (IsFormatEqual(format,
DataFormats
.Html)
1479
|| IsFormatEqual(format,
DataFormats
.Xaml))
1484
else if (IsFormatEqual(format,
DataFormats
.Text)
1485
|| IsFormatEqual(format,
DataFormats
.Rtf)
1486
|| IsFormatEqual(format,
DataFormats
.OemText)
1487
|| IsFormatEqual(format,
DataFormats
.CommaSeparatedValue))
1491
else if (IsFormatEqual(format,
DataFormats
.UnicodeText)||
1492
IsFormatEqual(format,
DataFormats
.ApplicationTrust))
1496
else if (IsFormatEqual(format,
DataFormats
.FileDrop))
1500
else if (IsFormatEqual(format,
DataFormats
.FileName))
1507
else if (IsFormatEqual(format,
DataFormats
.FileNameW))
1514
else if (IsFormatEqual(format,
DataFormats
.Dib)
1533
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile)
1541
else if (IsFormatEqual(format,
DataFormats
.Serializable)
1617
if (IsFormatEqual(format,
DataFormats
.Bitmap)
1652
if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
2099
IsFormatEqual(format,
DataFormats
.Serializable)
2184
(IsFormatEqual(format,
DataFormats
.Bitmap) || IsFormatEqual(format, SystemBitmapSourceFormat)))
2291
temp.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
2296
if (IsFormatEqual(format,
DataFormats
.Bitmap))
2300
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
2472
SetData(
DataFormats
.Serializable, data);
2510
name =
DataFormats
.GetDataFormat(formatetc[0].cfFormat).Name;
2699
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
2774
if (IsFormatEqual(format,
DataFormats
.Html)
2775
|| IsFormatEqual(format,
DataFormats
.Xaml))
2782
else if (IsFormatEqual(format,
DataFormats
.Text)
2783
|| IsFormatEqual(format,
DataFormats
.Rtf)
2784
|| IsFormatEqual(format,
DataFormats
.OemText)
2785
|| IsFormatEqual(format,
DataFormats
.CommaSeparatedValue))
2789
else if (IsFormatEqual(format,
DataFormats
.UnicodeText) ||
2790
IsFormatEqual(format,
DataFormats
.ApplicationTrust))
2794
else if (IsFormatEqual(format,
DataFormats
.FileDrop))
2798
else if (IsFormatEqual(format,
DataFormats
.FileName))
2802
else if (IsFormatEqual(format,
DataFormats
.FileNameW))
2839
(IsFormatEqual(format,
DataFormats
.StringFormat) ||
2840
IsFormatEqual(format,
DataFormats
.Dib) ||
2841
IsFormatEqual(format,
DataFormats
.Bitmap) ||
2842
IsFormatEqual(format,
DataFormats
.EnhancedMetafile) ||
2843
IsFormatEqual(format,
DataFormats
.MetafilePicture) ||
2844
IsFormatEqual(format,
DataFormats
.SymbolicLink) ||
2845
IsFormatEqual(format,
DataFormats
.Dif) ||
2846
IsFormatEqual(format,
DataFormats
.Tiff) ||
2847
IsFormatEqual(format,
DataFormats
.Palette) ||
2848
IsFormatEqual(format,
DataFormats
.PenData) ||
2849
IsFormatEqual(format,
DataFormats
.Riff) ||
2850
IsFormatEqual(format,
DataFormats
.WaveAudio) ||
2851
IsFormatEqual(format,
DataFormats
.Locale));
2871
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
2914
if (IsFormatEqual(format,
DataFormats
.Bitmap))
2918
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
2928
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
2942
if (IsFormatEqual(format,
DataFormats
.Bitmap))
2948
else if (IsFormatEqual(format,
DataFormats
.EnhancedMetafile))
3247
formatetc.cfFormat = (short)
DataFormats
.GetDataFormat(format).Id;
3473
&& !this._data.ContainsKey(
DataFormats
.Serializable))
3475
SetData(
DataFormats
.Serializable, data);
3497
if (IsFormatEqual(format,
DataFormats
.Dib))
3501
format =
DataFormats
.Bitmap;
PresentationCore.Tests (2)
BinaryFormat\DataObjectTests.cs (2)
25
dataObject.SetData(
DataFormats
.Serializable, value);
33
Assert.Throws<System.Runtime.InteropServices.COMException>(() => ClipboardDataObject.GetData(
DataFormats
.Serializable));
PresentationFramework (106)
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (14)
214
rtbRange.Save(buffer,
DataFormats
.Xaml);
240
rtbRange.Load(buffer,
DataFormats
.Xaml);
298
if (e.FormatToApply ==
DataFormats
.Rtf)
303
String rtfString = e.DataObject.GetData(
DataFormats
.Rtf) as String;
307
range.Load(data,
DataFormats
.Rtf);
311
range.Save(buffer,
DataFormats
.Xaml);
313
dataObject.SetData(
DataFormats
.Xaml, encoding.GetString(buffer.GetBuffer()));
315
e.FormatToApply =
DataFormats
.Xaml;
317
else if (e.FormatToApply ==
DataFormats
.Bitmap ||
318
e.FormatToApply ==
DataFormats
.EnhancedMetafile ||
319
e.FormatToApply ==
DataFormats
.MetafilePicture ||
320
e.FormatToApply ==
DataFormats
.Tiff)
325
else if (e.FormatToApply ==
DataFormats
.XamlPackage)
328
e.FormatToApply =
DataFormats
.Xaml;
MS\Internal\Ink\TextClipboardData.cs (6)
45
return ( dataObject.GetDataPresent(
DataFormats
.UnicodeText, false)
46
|| dataObject.GetDataPresent(
DataFormats
.Text, false)
47
|| dataObject.GetDataPresent(
DataFormats
.OemText, false) );
68
dataObject.SetData(
DataFormats
.UnicodeText, _text, true);
78
string text = dataObject.GetData(
DataFormats
.UnicodeText, true) as string;
83
text = dataObject.GetData(
DataFormats
.Text, true) as string;
MS\Internal\Ink\XamlClipboardData.cs (3)
48
bool hasXamlData = dataObject.GetDataPresent(
DataFormats
.Xaml, false);
90
dataObject.SetData(
DataFormats
.Xaml, xmlData.ToString());
99
string xml = dataObject.GetData(
DataFormats
.Xaml) as string;
System\Windows\Controls\DataGrid.cs (5)
8281
Collection<string> formats = new Collection<string>(new string[] {
DataFormats
.Html,
DataFormats
.Text,
DataFormats
.UnicodeText,
DataFormats
.CommaSeparatedValue });
8327
DataGridClipboardHelper.GetClipboardContentForHtml(dataGridStringBuilders[
DataFormats
.Html]);
System\Windows\Controls\DataGridClipboardHelper.cs (4)
20
bool csv = string.Equals(format,
DataFormats
.CommaSeparatedValue, StringComparison.OrdinalIgnoreCase);
21
if (csv || string.Equals(format,
DataFormats
.Text, StringComparison.OrdinalIgnoreCase)
22
|| string.Equals(format,
DataFormats
.UnicodeText, StringComparison.OrdinalIgnoreCase))
46
else if (string.Equals(format,
DataFormats
.Html, StringComparison.OrdinalIgnoreCase))
System\Windows\Documents\RubberbandSelector.cs (3)
176
dataObject.SetData(
DataFormats
.Text, textString, true);
177
dataObject.SetData(
DataFormats
.UnicodeText, textString, true);
180
dataObject.SetData(
DataFormats
.Bitmap, bmp, true);
System\windows\Documents\TextEditorCopyPaste.cs (55)
93
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Text))
95
dataObject.SetData(
DataFormats
.Text, textString, true);
100
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.UnicodeText))
102
dataObject.SetData(
DataFormats
.UnicodeText, textString, true);
120
if (wpfContainerMemory != null && ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.XamlPackage))
122
dataObject.SetData(
DataFormats
.XamlPackage, wpfContainerMemory);
126
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Rtf))
133
dataObject.SetData(
DataFormats
.Rtf, rtfText, true);
156
if (ConfirmDataFormatSetting(This.UiScope, dataObject,
DataFormats
.Xaml))
159
dataObject.SetData(
DataFormats
.Xaml, xamlText, false);
246
if (This.AcceptsRichContent && dataObject.GetDataPresent(
DataFormats
.XamlPackage))
248
formatToApply =
DataFormats
.XamlPackage;
250
else if (This.AcceptsRichContent && dataObject.GetDataPresent(
DataFormats
.Xaml))
252
formatToApply =
DataFormats
.Xaml;
254
else if (This.AcceptsRichContent && dataObject.GetDataPresent(
DataFormats
.Rtf))
256
formatToApply =
DataFormats
.Rtf;
258
else if (dataObject.GetDataPresent(
DataFormats
.UnicodeText))
260
formatToApply =
DataFormats
.UnicodeText;
262
else if (dataObject.GetDataPresent(
DataFormats
.Text))
264
formatToApply =
DataFormats
.Text;
268
formatToApply =
DataFormats
.Bitmap;
686
if (formatToApply ==
DataFormats
.Bitmap && dataObjectToApply is DataObject)
692
System.Windows.Media.Imaging.BitmapSource bitmapSource = GetPasteData(dataObjectToApply,
DataFormats
.Bitmap) as System.Windows.Media.Imaging.BitmapSource;
701
formatToApply =
DataFormats
.XamlPackage;
702
dataObjectToApply.SetData(
DataFormats
.XamlPackage, packagedImage);
707
if (formatToApply ==
DataFormats
.XamlPackage)
713
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.XamlPackage);
733
if (dataObjectToApply.GetDataPresent(
DataFormats
.Xaml))
735
formatToApply =
DataFormats
.Xaml;
737
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Rtf))
739
formatToApply =
DataFormats
.Rtf;
741
else if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
743
formatToApply =
DataFormats
.UnicodeText;
745
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
747
formatToApply =
DataFormats
.Text;
751
if (formatToApply ==
DataFormats
.Xaml)
755
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Xaml);
765
if (dataObjectToApply.GetDataPresent(
DataFormats
.Rtf))
767
formatToApply =
DataFormats
.Rtf;
769
else if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
771
formatToApply =
DataFormats
.UnicodeText;
773
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
775
formatToApply =
DataFormats
.Text;
779
if (formatToApply ==
DataFormats
.Rtf)
787
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Rtf);
806
if (dataObjectToApply.GetDataPresent(
DataFormats
.UnicodeText))
808
formatToApply =
DataFormats
.UnicodeText;
810
else if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
812
formatToApply =
DataFormats
.Text;
816
if (formatToApply ==
DataFormats
.UnicodeText)
818
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.UnicodeText);
821
if (dataObjectToApply.GetDataPresent(
DataFormats
.Text))
823
formatToApply =
DataFormats
.Text; // fall to plain text
836
if (formatToApply ==
DataFormats
.Text)
838
object pastedData = GetPasteData(dataObjectToApply,
DataFormats
.Text);
System\Windows\Documents\TextRangeBase.cs (16)
1477
dataFormat ==
DataFormats
.Text ||
1478
dataFormat ==
DataFormats
.Xaml ||
1479
((dataFormat ==
DataFormats
.XamlPackage ||
1480
dataFormat ==
DataFormats
.Rtf)));
1490
dataFormat ==
DataFormats
.Text ||
1491
dataFormat ==
DataFormats
.Xaml ||
1492
((dataFormat ==
DataFormats
.XamlPackage ||
1493
dataFormat ==
DataFormats
.Rtf)));
1505
if (dataFormat ==
DataFormats
.Text)
1512
else if (dataFormat ==
DataFormats
.Xaml)
1521
else if (dataFormat ==
DataFormats
.XamlPackage)
1527
else if (dataFormat ==
DataFormats
.Rtf)
1559
if (dataFormat ==
DataFormats
.Text)
1565
else if (dataFormat ==
DataFormats
.Xaml)
1571
else if (dataFormat ==
DataFormats
.XamlPackage)
1580
else if (dataFormat ==
DataFormats
.Rtf)