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
- DetailsViewPagerRow.cs
- ConfigurationStrings.cs
- DataGridColumnsPage.cs
- DataGridViewColumnConverter.cs
- MD5.cs
- Duration.cs
- CompositeActivityValidator.cs
- BitmapFrame.cs
- IdnElement.cs
- NativeObjectSecurity.cs
- IgnoreFileBuildProvider.cs
- TargetControlTypeCache.cs
- RepeaterItem.cs
- Pkcs9Attribute.cs
- ClientSettingsSection.cs
- XslTransform.cs
- DataSpaceManager.cs
- ProtocolViolationException.cs
- ZoneButton.cs
- ObjectCacheSettings.cs
- XmlDocumentSerializer.cs
- NoneExcludedImageIndexConverter.cs
- DataGridViewAdvancedBorderStyle.cs
- Translator.cs
- TableCellCollection.cs
- DataGridViewDataErrorEventArgs.cs
- SafeUserTokenHandle.cs
- OrderedDictionaryStateHelper.cs
- SqlDataRecord.cs
- PartialList.cs
- StrongNamePublicKeyBlob.cs
- XmlNamespaceMapping.cs
- RequestQueue.cs
- StylusPointPropertyInfoDefaults.cs
- EntityContainerEntitySetDefiningQuery.cs
- DataGridCellEditEndingEventArgs.cs
- ExpandableObjectConverter.cs
- ElementNotAvailableException.cs
- serverconfig.cs
- ObjectListSelectEventArgs.cs
- TextCompositionManager.cs
- NavigationPropertyEmitter.cs
- BinaryMethodMessage.cs
- EntityDataSource.cs
- GeneralTransform3DGroup.cs
- DataExchangeServiceBinder.cs
- ColorMatrix.cs
- DbConnectionFactory.cs
- View.cs
- SystemBrushes.cs
- TrimSurroundingWhitespaceAttribute.cs
- PropertyGeneratedEventArgs.cs
- XDeferredAxisSource.cs
- MutexSecurity.cs
- SerializationEventsCache.cs
- ProvideValueServiceProvider.cs
- ConstructorExpr.cs
- DrawingGroup.cs
- APCustomTypeDescriptor.cs
- DataGridViewSelectedCellCollection.cs
- SystemPens.cs
- LambdaExpression.cs
- TrackingSection.cs
- UpdateTranslator.cs
- SafeNativeMethodsCLR.cs
- ResXResourceWriter.cs
- ErrorInfoXmlDocument.cs
- Event.cs
- _DomainName.cs
- AssemblyAttributesGoHere.cs
- WorkflowApplicationTerminatedException.cs
- XmlUtil.cs
- GridPatternIdentifiers.cs
- PanningMessageFilter.cs
- SendMailErrorEventArgs.cs
- NetworkAddressChange.cs
- List.cs
- SystemException.cs
- SimpleMailWebEventProvider.cs
- AuthenticationModulesSection.cs
- WorkflowServiceBehavior.cs
- CacheMemory.cs
- ExpressionNormalizer.cs
- XmlCollation.cs
- NaturalLanguageHyphenator.cs
- DrawItemEvent.cs
- RPIdentityRequirement.cs
- TemplateKey.cs
- SizeAnimationClockResource.cs
- DataSetMappper.cs
- HtmlInputControl.cs
- BaseTemplateParser.cs
- WebPartConnectionsConnectVerb.cs
- LinqDataSourceHelper.cs
- ScriptReferenceBase.cs
- Context.cs
- Semaphore.cs
- DrawingDrawingContext.cs
- DrawingContext.cs
- SignatureToken.cs