Code:
/ DotNET / DotNET / 8.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
- FixUp.cs
- SelectionHighlightInfo.cs
- ToolbarAUtomationPeer.cs
- EntityDataSourceContextCreatedEventArgs.cs
- _TLSstream.cs
- Console.cs
- ComPlusTypeLoader.cs
- EntityDesignerUtils.cs
- StructuredProperty.cs
- IPGlobalProperties.cs
- PasswordTextNavigator.cs
- FilteredXmlReader.cs
- CharStorage.cs
- Material.cs
- AdjustableArrowCap.cs
- HostedHttpRequestAsyncResult.cs
- HtmlSelect.cs
- SpellerStatusTable.cs
- BindingManagerDataErrorEventArgs.cs
- XmlSerializerNamespaces.cs
- DefaultMemberAttribute.cs
- SchemaSetCompiler.cs
- StateDesignerConnector.cs
- XmlCodeExporter.cs
- XmlBinaryReader.cs
- OdbcParameterCollection.cs
- ZipIOLocalFileBlock.cs
- Messages.cs
- Renderer.cs
- __ConsoleStream.cs
- FilteredDataSetHelper.cs
- GuidelineSet.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- XPathNodeIterator.cs
- TableLayoutCellPaintEventArgs.cs
- XDeferredAxisSource.cs
- TCPListener.cs
- GatewayIPAddressInformationCollection.cs
- ExtensionSimplifierMarkupObject.cs
- AdornerHitTestResult.cs
- MailAddressCollection.cs
- OleDbPropertySetGuid.cs
- ApplicationException.cs
- _Rfc2616CacheValidators.cs
- CharKeyFrameCollection.cs
- GenericTypeParameterConverter.cs
- basevalidator.cs
- Fault.cs
- uribuilder.cs
- XmlIgnoreAttribute.cs
- SafeFileHandle.cs
- DataStorage.cs
- WeakEventManager.cs
- CodeNamespaceCollection.cs
- DataColumnCollection.cs
- _emptywebproxy.cs
- MachineKeyValidationConverter.cs
- BinaryMethodMessage.cs
- AffineTransform3D.cs
- VerticalAlignConverter.cs
- SqlEnums.cs
- XsltLoader.cs
- ControlValuePropertyAttribute.cs
- remotingproxy.cs
- OlePropertyStructs.cs
- OrderByBuilder.cs
- EventBuilder.cs
- KnownTypeAttribute.cs
- Propagator.JoinPropagator.cs
- TcpSocketManager.cs
- ImageListImage.cs
- ListViewItem.cs
- CreateParams.cs
- panel.cs
- CharStorage.cs
- FilterQueryOptionExpression.cs
- _WebProxyDataBuilder.cs
- TextWriterTraceListener.cs
- ScriptManagerProxy.cs
- RSAOAEPKeyExchangeFormatter.cs
- SoapSchemaMember.cs
- DelegatedStream.cs
- QilCloneVisitor.cs
- BasePattern.cs
- RowVisual.cs
- BamlStream.cs
- WindowsListViewScroll.cs
- Int32Converter.cs
- DbException.cs
- AnchoredBlock.cs
- ActivityTypeResolver.xaml.cs
- hebrewshape.cs
- WindowsListViewGroupSubsetLink.cs
- FormViewInsertedEventArgs.cs
- BinaryHeap.cs
- XmlSchemaImporter.cs
- Ray3DHitTestResult.cs
- FullTextState.cs
- PassportAuthenticationEventArgs.cs
- UnderstoodHeaders.cs