Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1305376 / 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
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CachedTypeface.cs
- TextServicesDisplayAttribute.cs
- CatalogPart.cs
- TypeFieldSchema.cs
- FileVersion.cs
- TypographyProperties.cs
- Ipv6Element.cs
- IOException.cs
- QilChoice.cs
- RevocationPoint.cs
- ExpressionConverter.cs
- Certificate.cs
- Context.cs
- ErrorStyle.cs
- LicenseManager.cs
- ConfigXmlReader.cs
- KeySpline.cs
- ClassGenerator.cs
- X509ChainElement.cs
- DataGridItemEventArgs.cs
- LicenseContext.cs
- FormatterConverter.cs
- Canvas.cs
- XmlNodeChangedEventManager.cs
- DesignerDataRelationship.cs
- UIAgentAsyncEndRequest.cs
- Point3DKeyFrameCollection.cs
- DefaultPropertyAttribute.cs
- ReadOnlyObservableCollection.cs
- DataServiceBehavior.cs
- Roles.cs
- PeerTransportSecuritySettings.cs
- EncoderNLS.cs
- ProcessHostConfigUtils.cs
- MatrixValueSerializer.cs
- XmlHierarchyData.cs
- Token.cs
- CanExecuteRoutedEventArgs.cs
- DelegateSerializationHolder.cs
- UInt64Storage.cs
- RowToFieldTransformer.cs
- BaseContextMenu.cs
- PropertyStore.cs
- FocusManager.cs
- ObjectDataSourceDisposingEventArgs.cs
- WindowsFormsHelpers.cs
- unitconverter.cs
- StandardOleMarshalObject.cs
- LingerOption.cs
- CheckBoxFlatAdapter.cs
- RelatedPropertyManager.cs
- _SSPISessionCache.cs
- SiteIdentityPermission.cs
- TimerEventSubscriptionCollection.cs
- _TransmitFileOverlappedAsyncResult.cs
- XPathItem.cs
- SizeValueSerializer.cs
- DataViewManagerListItemTypeDescriptor.cs
- SigningCredentials.cs
- PropertyItem.cs
- HWStack.cs
- PeerNameResolver.cs
- _StreamFramer.cs
- ContextItemManager.cs
- MarkupExtensionReturnTypeAttribute.cs
- CodeAttachEventStatement.cs
- RichTextBox.cs
- PointIndependentAnimationStorage.cs
- DataReceivedEventArgs.cs
- XmlQueryOutput.cs
- LineSegment.cs
- ForEachAction.cs
- RTLAwareMessageBox.cs
- WindowsStatusBar.cs
- ProviderUtil.cs
- DesignTimeTemplateParser.cs
- GridViewRowCollection.cs
- ListViewItemEventArgs.cs
- ProviderException.cs
- ListenerElementsCollection.cs
- RoutedEventConverter.cs
- objectquery_tresulttype.cs
- SQLDateTime.cs
- IisTraceWebEventProvider.cs
- StatusStrip.cs
- PropertyConverter.cs
- XmlSiteMapProvider.cs
- System.Data.OracleClient_BID.cs
- OrderByLifter.cs
- Convert.cs
- InvalidComObjectException.cs
- SoapMessage.cs
- ParserExtension.cs
- ControlBuilderAttribute.cs
- TemplateBuilder.cs
- ElementAction.cs
- PageContentAsyncResult.cs
- ConfigViewGenerator.cs
- GetCardDetailsRequest.cs
- NativeMethods.cs