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
- IgnoreSection.cs
- StringArrayConverter.cs
- IArgumentProvider.cs
- SessionParameter.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- AdapterUtil.cs
- ConfigViewGenerator.cs
- HyperLinkStyle.cs
- TreeViewCancelEvent.cs
- RemoteWebConfigurationHost.cs
- ClientRoleProvider.cs
- Psha1DerivedKeyGenerator.cs
- Polygon.cs
- ZipIOFileItemStream.cs
- NativeWindow.cs
- TypeToStringValueConverter.cs
- XmlRawWriterWrapper.cs
- LinkLabelLinkClickedEvent.cs
- MsmqInputChannel.cs
- VectorCollectionValueSerializer.cs
- PopOutPanel.cs
- EdmToObjectNamespaceMap.cs
- MonitoringDescriptionAttribute.cs
- RSAPKCS1SignatureDeformatter.cs
- MatrixTransform.cs
- SqlRowUpdatingEvent.cs
- CreationContext.cs
- TypeSystem.cs
- OrderedEnumerableRowCollection.cs
- EntityConnectionStringBuilderItem.cs
- SpecularMaterial.cs
- FontStyle.cs
- DefaultTextStore.cs
- UIElement3DAutomationPeer.cs
- IISUnsafeMethods.cs
- MessageVersionConverter.cs
- XmlTextEncoder.cs
- TdsParserHelperClasses.cs
- EmptyStringExpandableObjectConverter.cs
- DllNotFoundException.cs
- DocumentViewerAutomationPeer.cs
- ToolStripPanelCell.cs
- Label.cs
- SizeAnimationBase.cs
- Attributes.cs
- HealthMonitoringSection.cs
- MediaSystem.cs
- MDIWindowDialog.cs
- ScriptMethodAttribute.cs
- RepeaterItemCollection.cs
- ScriptManager.cs
- CacheForPrimitiveTypes.cs
- AssociationTypeEmitter.cs
- ColorContextHelper.cs
- CompilationRelaxations.cs
- HostExecutionContextManager.cs
- MaterialGroup.cs
- XpsFixedDocumentReaderWriter.cs
- _AcceptOverlappedAsyncResult.cs
- ServicesExceptionNotHandledEventArgs.cs
- RectAnimationClockResource.cs
- TableRowCollection.cs
- ExpressionList.cs
- FileLevelControlBuilderAttribute.cs
- ScalarConstant.cs
- TemplatedMailWebEventProvider.cs
- SqlWorkflowPersistenceService.cs
- DurableInstancingOptions.cs
- LambdaCompiler.Expressions.cs
- NativeMethods.cs
- IdentifierCreationService.cs
- MediaTimeline.cs
- HttpCacheVaryByContentEncodings.cs
- SqlConnection.cs
- PhoneCall.cs
- PermissionListSet.cs
- DrawListViewItemEventArgs.cs
- ResourceDisplayNameAttribute.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- ApplicationGesture.cs
- DocumentSchemaValidator.cs
- HTMLTagNameToTypeMapper.cs
- PageCopyCount.cs
- SQLBinary.cs
- IriParsingElement.cs
- DrawingVisual.cs
- FlowLayout.cs
- TypeInfo.cs
- OdbcFactory.cs
- SoapException.cs
- QuaternionKeyFrameCollection.cs
- StringSorter.cs
- IIS7UserPrincipal.cs
- DesignTimeParseData.cs
- BackgroundWorker.cs
- AnnotationMap.cs
- SpecialFolderEnumConverter.cs
- RegexCapture.cs
- SystemFonts.cs
- DesigntimeLicenseContextSerializer.cs