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