<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.6.25358.103" />

DataFormatNames

static class DataFormatNames
using System.Collections.Generic; using System.Runtime.CompilerServices; namespace System.Private.Windows.Ole { [NullableContext(1)] [Nullable(0)] internal static class DataFormatNames { internal const string Text = "Text"; internal const string UnicodeText = "UnicodeText"; internal const string Dib = "DeviceIndependentBitmap"; internal const string Bitmap = "Bitmap"; internal const string Emf = "EnhancedMetafile"; internal const string Wmf = "MetaFilePict"; internal const string SymbolicLink = "SymbolicLink"; internal const string Dif = "DataInterchangeFormat"; internal const string Tiff = "TaggedImageFileFormat"; internal const string OemText = "OEMText"; internal const string Palette = "Palette"; internal const string PenData = "PenData"; internal const string Riff = "RiffAudio"; internal const string WaveAudio = "WaveAudio"; internal const string FileDrop = "FileDrop"; internal const string Locale = "Locale"; internal const string Html = "HTML Format"; internal const string Rtf = "Rich Text Format"; internal const string Csv = "Csv"; internal const string String = "System.String"; internal const string Serializable = "PersistentObject"; internal const string Xaml = "Xaml"; internal const string XamlPackage = "XamlPackage"; internal const string InkSerializedFormat = "Ink Serialized Format"; internal const string FileNameAnsi = "FileName"; internal const string FileNameUnicode = "FileNameW"; internal const string BinaryFormatBitmap = "System.Drawing.Bitmap"; internal const string BinaryFormatMetafile = "System.Drawing.Imaging.Metafile"; internal const string DragContext = "DragContext"; internal const string DragImageBits = "DragImageBits"; internal const string DragSourceHelperFlags = "DragSourceHelperFlags"; internal const string DragWindow = "DragWindow"; internal const string IsShowingLayered = "IsShowingLayered"; internal const string IsShowingText = "IsShowingText"; internal const string UsingDefaultDragImage = "UsingDefaultDragImage"; internal static void AddMappedFormats<[Nullable(0)] T>(string format, T formats) where T : ICollection<string> { if (format != null) { switch (format.Length) { case 8: switch (format[4]) { case 'D': if (format == "FileDrop") { ((ICollection<string>)formats).Add("FileNameW"); ((ICollection<string>)formats).Add("FileName"); return; } break; case 'N': if (format == "FileName") { ((ICollection<string>)formats).Add("FileDrop"); ((ICollection<string>)formats).Add("FileNameW"); return; } break; } break; case 4: if (format == "Text") { ((ICollection<string>)formats).Add("System.String"); ((ICollection<string>)formats).Add("UnicodeText"); return; } break; case 11: if (format == "UnicodeText") { ((ICollection<string>)formats).Add("System.String"); ((ICollection<string>)formats).Add("Text"); return; } break; case 13: if (format == "System.String") { ((ICollection<string>)formats).Add("Text"); ((ICollection<string>)formats).Add("UnicodeText"); return; } break; case 9: if (format == "FileNameW") { ((ICollection<string>)formats).Add("FileDrop"); ((ICollection<string>)formats).Add("FileName"); return; } break; case 6: if (format == "Bitmap") { ((ICollection<string>)formats).Add("System.Drawing.Bitmap"); return; } break; case 21: if (format == "System.Drawing.Bitmap") { ((ICollection<string>)formats).Add("Bitmap"); return; } break; case 16: if (format == "EnhancedMetafile") { ((ICollection<string>)formats).Add("System.Drawing.Imaging.Metafile"); return; } break; case 31: if (format == "System.Drawing.Imaging.Metafile") { ((ICollection<string>)formats).Add("EnhancedMetafile"); return; } break; } } if (string.Equals(format, "Text", StringComparison.OrdinalIgnoreCase)) { ((ICollection<string>)formats).Add("System.String"); ((ICollection<string>)formats).Add("UnicodeText"); } else if (string.Equals(format, "UnicodeText", StringComparison.OrdinalIgnoreCase)) { ((ICollection<string>)formats).Add("System.String"); ((ICollection<string>)formats).Add("Text"); } else if (string.Equals(format, "System.String", StringComparison.OrdinalIgnoreCase)) { ((ICollection<string>)formats).Add("Text"); ((ICollection<string>)formats).Add("UnicodeText"); } } internal static bool IsPredefinedFormat(string format) { if (format != null) { switch (format.Length) { case 11: switch (format[0]) { case 'U': break; case 'H': goto IL_0198; default: goto IL_031d; } if (!(format == "UnicodeText")) break; goto IL_0319; case 16: switch (format[0]) { case 'R': break; case 'E': goto IL_01c2; default: goto IL_031d; } if (!(format == "Rich Text Format")) break; goto IL_0319; case 7: switch (format[1]) { case 'E': break; case 'e': goto IL_01ec; case 'a': goto IL_0201; default: goto IL_031d; } if (!(format == "OEMText")) break; goto IL_0319; case 8: switch (format[4]) { case 'D': break; case 'N': goto IL_022b; default: goto IL_031d; } if (!(format == "FileDrop")) break; goto IL_0319; case 9: switch (format[0]) { case 'F': break; case 'R': goto IL_0255; case 'W': goto IL_026a; default: goto IL_031d; } if (!(format == "FileNameW")) break; goto IL_0319; case 21: switch (format[0]) { case 'S': break; case 'D': goto IL_02a3; case 'T': goto IL_02b2; default: goto IL_031d; } if (!(format == "System.Drawing.Bitmap")) break; goto IL_0319; case 6: switch (format[0]) { case 'L': break; case 'B': goto IL_02ee; default: goto IL_031d; } if (!(format == "Locale")) break; goto IL_0319; case 12: switch (format[0]) { case 'S': break; case 'M': goto IL_030c; default: goto IL_031d; } if (!(format == "SymbolicLink")) break; goto IL_0319; case 4: if (!(format == "Text")) break; goto IL_0319; case 13: if (!(format == "System.String")) break; goto IL_0319; case 3: if (!(format == "Csv")) break; goto IL_0319; case 23: { if (!(format == "DeviceIndependentBitmap")) break; goto IL_0319; } IL_030c: if (!(format == "MetaFilePict")) break; goto IL_0319; IL_0198: if (!(format == "HTML Format")) break; goto IL_0319; IL_02ee: if (!(format == "Bitmap")) break; goto IL_0319; IL_02b2: if (!(format == "TaggedImageFileFormat")) break; goto IL_0319; IL_02a3: if (!(format == "DataInterchangeFormat")) break; goto IL_0319; IL_01c2: if (!(format == "EnhancedMetafile")) break; goto IL_0319; IL_026a: if (!(format == "WaveAudio")) break; goto IL_0319; IL_0255: if (!(format == "RiffAudio")) break; goto IL_0319; IL_0319: return true; IL_022b: if (!(format == "FileName")) break; goto IL_0319; IL_0201: if (!(format == "Palette")) break; goto IL_0319; IL_01ec: if (!(format == "PenData")) break; goto IL_0319; } } goto IL_031d; IL_031d: return false; } } }