Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1 / PropertyItemInternal.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Imaging { using System.Runtime.InteropServices; using System; using System.Drawing; // sdkinc\imaging.h [StructLayout(LayoutKind.Sequential)] internal sealed class PropertyItemInternal : IDisposable { public int id; public int len; public short type; public IntPtr value = IntPtr.Zero; internal PropertyItemInternal() { } ~PropertyItemInternal() { Dispose(false); } public void Dispose() { Dispose(true); } private void Dispose(bool disposing) { if (value != IntPtr.Zero) { Marshal.FreeHGlobal(value); value = IntPtr.Zero; } if( disposing ) { GC.SuppressFinalize(this); } } internal static PropertyItemInternal ConvertFromPropertyItem(PropertyItem propItem) { PropertyItemInternal propItemInternal = new PropertyItemInternal(); propItemInternal.id = propItem.Id; propItemInternal.len = propItem.Len; propItemInternal.type = propItem.Type; byte[] propItemValue = propItem.Value; if (propItemValue != null) { propItemInternal.value = Marshal.AllocHGlobal(propItemValue.Length); Marshal.Copy(propItemValue, 0, propItemInternal.value, propItemValue.Length); } return propItemInternal; } internal static PropertyItem[] ConvertFromMemory(IntPtr propdata, int count) { PropertyItem[] props = new PropertyItem[count]; for (int i=0; i// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Imaging { using System.Runtime.InteropServices; using System; using System.Drawing; // sdkinc\imaging.h [StructLayout(LayoutKind.Sequential)] internal sealed class PropertyItemInternal : IDisposable { public int id; public int len; public short type; public IntPtr value = IntPtr.Zero; internal PropertyItemInternal() { } ~PropertyItemInternal() { Dispose(false); } public void Dispose() { Dispose(true); } private void Dispose(bool disposing) { if (value != IntPtr.Zero) { Marshal.FreeHGlobal(value); value = IntPtr.Zero; } if( disposing ) { GC.SuppressFinalize(this); } } internal static PropertyItemInternal ConvertFromPropertyItem(PropertyItem propItem) { PropertyItemInternal propItemInternal = new PropertyItemInternal(); propItemInternal.id = propItem.Id; propItemInternal.len = propItem.Len; propItemInternal.type = propItem.Type; byte[] propItemValue = propItem.Value; if (propItemValue != null) { propItemInternal.value = Marshal.AllocHGlobal(propItemValue.Length); Marshal.Copy(propItemValue, 0, propItemInternal.value, propItemValue.Length); } return propItemInternal; } internal static PropertyItem[] ConvertFromMemory(IntPtr propdata, int count) { PropertyItem[] props = new PropertyItem[count]; for (int i=0; i
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StoreContentChangedEventArgs.cs
- MsdtcClusterUtils.cs
- DSACryptoServiceProvider.cs
- AppDomainProtocolHandler.cs
- MediaContext.cs
- IgnorePropertiesAttribute.cs
- wgx_sdk_version.cs
- ObjectReaderCompiler.cs
- SeekStoryboard.cs
- OutKeywords.cs
- Content.cs
- ZoomingMessageFilter.cs
- ArrayList.cs
- XmlValidatingReader.cs
- ping.cs
- PaginationProgressEventArgs.cs
- DataFieldEditor.cs
- _BaseOverlappedAsyncResult.cs
- SessionIDManager.cs
- SourceItem.cs
- StringTraceRecord.cs
- ListBoxItemWrapperAutomationPeer.cs
- SQLInt16.cs
- Padding.cs
- StringComparer.cs
- AttributeSetAction.cs
- ScrollViewer.cs
- EdmComplexPropertyAttribute.cs
- OleDbCommandBuilder.cs
- ExpressionConverter.cs
- _Connection.cs
- EntityDataSourceValidationException.cs
- FloaterParagraph.cs
- UrlParameterWriter.cs
- COAUTHIDENTITY.cs
- DefaultAuthorizationContext.cs
- ResponseBodyWriter.cs
- ResourcePermissionBaseEntry.cs
- OrderedDictionary.cs
- WebDescriptionAttribute.cs
- PageSettings.cs
- Point3DConverter.cs
- SR.cs
- DataGrid.cs
- Visitors.cs
- CustomExpression.cs
- CatalogPartCollection.cs
- SerializationAttributes.cs
- CalendarDayButton.cs
- basenumberconverter.cs
- MimeWriter.cs
- DataGridTable.cs
- CodeNamespaceImportCollection.cs
- UpdatePanel.cs
- UpdateProgress.cs
- SpinWait.cs
- Type.cs
- EntityContainerEntitySetDefiningQuery.cs
- ValidationService.cs
- ImportCatalogPart.cs
- NumberAction.cs
- Delay.cs
- ZoneIdentityPermission.cs
- BitmapEffectGroup.cs
- Itemizer.cs
- MaterialCollection.cs
- InvokeBase.cs
- TraceHandlerErrorFormatter.cs
- Content.cs
- LinqDataSourceEditData.cs
- CustomDictionarySources.cs
- ActivityContext.cs
- AspNetHostingPermission.cs
- ResolveNameEventArgs.cs
- GeneralTransform3DTo2DTo3D.cs
- ZoneMembershipCondition.cs
- TextMetrics.cs
- DrawingContextWalker.cs
- Converter.cs
- ComponentEvent.cs
- streamingZipPartStream.cs
- DateBoldEvent.cs
- SHA512CryptoServiceProvider.cs
- WebPartConnectionCollection.cs
- jithelpers.cs
- CompilerResults.cs
- DSASignatureDeformatter.cs
- FileDialog.cs
- SelectionRange.cs
- ObjRef.cs
- EdmFunctionAttribute.cs
- NameNode.cs
- MatrixTransform3D.cs
- EntityTypeBase.cs
- XmlSchemaInferenceException.cs
- COM2ComponentEditor.cs
- ListControlDataBindingHandler.cs
- SoapExtensionTypeElement.cs
- PointAnimation.cs
- ImmutableObjectAttribute.cs