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
- ServiceInfoCollection.cs
- XmlSchema.cs
- DoubleLinkList.cs
- AnimationException.cs
- IndexerNameAttribute.cs
- UpDownEvent.cs
- WsatConfiguration.cs
- ProfileService.cs
- DataGridViewRowCollection.cs
- SafeProcessHandle.cs
- TranslateTransform3D.cs
- MulticastIPAddressInformationCollection.cs
- SqlCommand.cs
- CodeArrayCreateExpression.cs
- XmlSchemaObjectCollection.cs
- BitmapImage.cs
- ApplicationServicesHostFactory.cs
- ToolStripPanelCell.cs
- QueryGenerator.cs
- ProjectionCamera.cs
- Profiler.cs
- ImageDrawing.cs
- DropTarget.cs
- TextTreeFixupNode.cs
- TemplateParser.cs
- NumberFunctions.cs
- DeviceContext2.cs
- Frame.cs
- FunctionMappingTranslator.cs
- CharacterString.cs
- XamlBrushSerializer.cs
- OneToOneMappingSerializer.cs
- LineVisual.cs
- HostDesigntimeLicenseContext.cs
- CodeTypeMember.cs
- WebServiceMethodData.cs
- _IPv6Address.cs
- FtpWebResponse.cs
- PersianCalendar.cs
- FormViewDesigner.cs
- DataDocumentXPathNavigator.cs
- SqlCacheDependencySection.cs
- RegexStringValidatorAttribute.cs
- DelegateSerializationHolder.cs
- DrawingContextDrawingContextWalker.cs
- WebMessageEncoderFactory.cs
- ImageKeyConverter.cs
- RotationValidation.cs
- DbException.cs
- PeerToPeerException.cs
- WindowsClaimSet.cs
- SinglePageViewer.cs
- StreamMarshaler.cs
- ListenerAdapterBase.cs
- NetNamedPipeSecurityMode.cs
- HostVisual.cs
- CssTextWriter.cs
- ClientProxyGenerator.cs
- RtfNavigator.cs
- DataGridViewCellCancelEventArgs.cs
- Route.cs
- UnsafeNativeMethodsCLR.cs
- BasicExpandProvider.cs
- SchemaMerger.cs
- OneOfTypeConst.cs
- NewArrayExpression.cs
- SqlUtil.cs
- LayoutEngine.cs
- WebPartZoneBase.cs
- AutomationAttributeInfo.cs
- SHA1CryptoServiceProvider.cs
- _CommandStream.cs
- AsymmetricSignatureDeformatter.cs
- CqlParser.cs
- FixedStringLookup.cs
- SocketInformation.cs
- Dispatcher.cs
- WebUtility.cs
- SetMemberBinder.cs
- LineInfo.cs
- _OSSOCK.cs
- GeneralTransformGroup.cs
- DataServiceEntityAttribute.cs
- HttpCachePolicy.cs
- AQNBuilder.cs
- NavigationService.cs
- CultureMapper.cs
- Calendar.cs
- SafePEFileHandle.cs
- WorkflowInstance.cs
- InteropEnvironment.cs
- SmtpLoginAuthenticationModule.cs
- PerfCounterSection.cs
- NamedPermissionSet.cs
- ImageMapEventArgs.cs
- SqlBuilder.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- RuntimeCompatibilityAttribute.cs
- Collection.cs
- HelloMessageApril2005.cs