void DecoratePackageWithClipboardDataFromRawDataAndFormat( IClipboardDataPackage package, uint format, byte[] rawData) { var factory = FindCapableFactoryFromFormat(format); var clipboardData = factory?.BuildData(format, rawData); if (clipboardData != null) { package.AddData(clipboardData); } }
void DecoratePackageWithClipboardDataFromRawDataAndFormat( IClipboardDataPackage package, IClipboardFormat format, byte[] rawData) { var factory = FindCapableFactoryFromFormat(format); logger.Information("Generating clipboard data object for format {format} using {factory}.", format, factory.GetType().Name); var clipboardData = factory.BuildData(format, rawData); if (clipboardData != null) { package.AddData(clipboardData); } }
private void DecoratePackageWithFormatDataUsingFactory( IClipboardDataPackage package, IClipboardDataControlFactory factory, uint format) { var unwrapper = memoryUnwrappers.FirstOrDefault(x => x.CanUnwrap(format)); var rawData = unwrapper?.UnwrapStructure(format); if (rawData == null) return; var clipboardData = factory.BuildData(format, rawData); if (clipboardData != null) { package.AddData(clipboardData); } }