Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1 / PropertyItemInternal.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /*************************************************************************\ * * Copyright (c) 1998-1999, Microsoft Corp. All Rights Reserved. * * Module Name: * * PropertyItem.cs * * Abstract: * * Native GDI+ PropertyItem structure. * * Revision History: * * 3/3/2k [....] * Created it. * \**************************************************************************/ 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
- PopupEventArgs.cs
- NetDataContractSerializer.cs
- RelatedEnd.cs
- PartialCachingAttribute.cs
- OracleConnection.cs
- HtmlButton.cs
- ScaleTransform.cs
- HttpListenerRequest.cs
- AutomationPeer.cs
- TlsnegoTokenAuthenticator.cs
- StorageAssociationTypeMapping.cs
- AmbientValueAttribute.cs
- SqlTypeSystemProvider.cs
- Label.cs
- HttpCapabilitiesBase.cs
- ValuePattern.cs
- Animatable.cs
- ContextMenu.cs
- GAC.cs
- RSAProtectedConfigurationProvider.cs
- GetPageNumberCompletedEventArgs.cs
- SizeLimitedCache.cs
- CodeSubDirectory.cs
- ItemCollection.cs
- FormsIdentity.cs
- ClientUriBehavior.cs
- FontCacheLogic.cs
- GiveFeedbackEvent.cs
- FontDriver.cs
- GlobalizationSection.cs
- UInt32.cs
- BamlTreeNode.cs
- SchemaElement.cs
- WorkflowView.cs
- FileStream.cs
- BinHexDecoder.cs
- EntityTypeEmitter.cs
- List.cs
- BitmapFrame.cs
- WorkflowRuntimeSection.cs
- Control.cs
- OutgoingWebRequestContext.cs
- MsmqTransportElement.cs
- SspiNegotiationTokenProvider.cs
- WindowsTooltip.cs
- SchemaMerger.cs
- DefinitionBase.cs
- DataSourceProvider.cs
- CellParagraph.cs
- AndCondition.cs
- MissingMethodException.cs
- HttpStreamXmlDictionaryWriter.cs
- CharUnicodeInfo.cs
- TemplateKey.cs
- HttpModuleActionCollection.cs
- AnnotationResourceChangedEventArgs.cs
- HttpValueCollection.cs
- DataAdapter.cs
- Baml6ConstructorInfo.cs
- SoapMessage.cs
- ScrollChangedEventArgs.cs
- SmiContext.cs
- Brushes.cs
- IfJoinedCondition.cs
- SiteMapNodeCollection.cs
- _DomainName.cs
- XmlSignatureProperties.cs
- EntityDataSourceMemberPath.cs
- WindowsRichEdit.cs
- TextElementEnumerator.cs
- InvokeMethodActivity.cs
- DbConnectionStringBuilder.cs
- GroupDescription.cs
- ObjectStateFormatter.cs
- CurrentChangedEventManager.cs
- MultiByteCodec.cs
- TextParagraphCache.cs
- sqlstateclientmanager.cs
- TextLineBreak.cs
- SelectedGridItemChangedEvent.cs
- EpmSyndicationContentSerializer.cs
- GridEntryCollection.cs
- Native.cs
- HttpCapabilitiesSectionHandler.cs
- ImageBrush.cs
- XamlReaderHelper.cs
- Size3DConverter.cs
- ReachVisualSerializer.cs
- DbDataRecord.cs
- WebPartDisplayMode.cs
- BooleanAnimationBase.cs
- AdCreatedEventArgs.cs
- TcpHostedTransportConfiguration.cs
- Control.cs
- XmlAttribute.cs
- CryptoKeySecurity.cs
- FileStream.cs
- SortExpressionBuilder.cs
- ThreadStaticAttribute.cs
- VisualTreeUtils.cs