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
- LightweightCodeGenerator.cs
- WebPartMenu.cs
- PropertyValueUIItem.cs
- path.cs
- OdbcConnectionFactory.cs
- COM2EnumConverter.cs
- StateMachine.cs
- StreamAsIStream.cs
- X509Certificate.cs
- HMACMD5.cs
- OleDbRowUpdatedEvent.cs
- ToolboxComponentsCreatedEventArgs.cs
- EntityDataSourceUtil.cs
- InstanceKey.cs
- OutputCacheModule.cs
- SQLSingle.cs
- ButtonBaseAutomationPeer.cs
- BamlResourceContent.cs
- DesignBindingConverter.cs
- OptimizerPatterns.cs
- FormsAuthenticationCredentials.cs
- RequestCachingSection.cs
- LineUtil.cs
- TextContainerChangedEventArgs.cs
- SelectionPatternIdentifiers.cs
- Helpers.cs
- StreamFormatter.cs
- sortedlist.cs
- ClonableStack.cs
- KeyValuePairs.cs
- InheritanceContextHelper.cs
- ImplicitInputBrush.cs
- SqlRecordBuffer.cs
- UiaCoreTypesApi.cs
- ThicknessKeyFrameCollection.cs
- HotSpotCollection.cs
- ContainerFilterService.cs
- AuthenticatingEventArgs.cs
- KnownBoxes.cs
- messageonlyhwndwrapper.cs
- GlyphTypeface.cs
- SecurityContextCookieSerializer.cs
- ElementMarkupObject.cs
- MulticastDelegate.cs
- OleDbRowUpdatingEvent.cs
- safelink.cs
- CodeMemberField.cs
- ProxyElement.cs
- SmtpReplyReaderFactory.cs
- TimeoutValidationAttribute.cs
- SqlDataSourceCommandEventArgs.cs
- SizeAnimation.cs
- MobileErrorInfo.cs
- WizardPanelChangingEventArgs.cs
- PointLightBase.cs
- DateTimeOffset.cs
- SmiEventSink_Default.cs
- SystemParameters.cs
- unitconverter.cs
- HttpHeaderCollection.cs
- dataprotectionpermissionattribute.cs
- SeparatorAutomationPeer.cs
- ToolStripTextBox.cs
- SafeArrayTypeMismatchException.cs
- GridViewAutoFormat.cs
- OrthographicCamera.cs
- Transform3D.cs
- ToolStripPanelCell.cs
- SimpleRecyclingCache.cs
- DetailsViewPageEventArgs.cs
- TemplateControl.cs
- ResourcePermissionBaseEntry.cs
- DownloadProgressEventArgs.cs
- Selector.cs
- DataGridViewSelectedRowCollection.cs
- DataGridViewTextBoxColumn.cs
- ColumnHeader.cs
- SkewTransform.cs
- TemplateXamlParser.cs
- CompensationHandlingFilter.cs
- TextEndOfLine.cs
- XmlResolver.cs
- ValidationEventArgs.cs
- ArgIterator.cs
- EventSource.cs
- URIFormatException.cs
- StringFormat.cs
- Logging.cs
- ClientBuildManagerCallback.cs
- RectAnimationBase.cs
- ControlsConfig.cs
- MultiDataTrigger.cs
- MethodBuilder.cs
- VideoDrawing.cs
- ThicknessConverter.cs
- MgmtConfigurationRecord.cs
- FastEncoder.cs
- ToolStripHighContrastRenderer.cs
- ModelFunctionTypeElement.cs
- OuterGlowBitmapEffect.cs