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
- GACIdentityPermission.cs
- KeyboardDevice.cs
- FontCacheLogic.cs
- XmlEnumAttribute.cs
- CommonXSendMessage.cs
- PhoneCallDesigner.cs
- FlowLayoutSettings.cs
- WindowCollection.cs
- ValueUnavailableException.cs
- ScriptReference.cs
- DateTimeOffsetConverter.cs
- Parser.cs
- AppSettings.cs
- NullRuntimeConfig.cs
- ExeConfigurationFileMap.cs
- EdmProviderManifest.cs
- DayRenderEvent.cs
- BuildManagerHost.cs
- WmpBitmapDecoder.cs
- LayoutEditorPart.cs
- EdmEntityTypeAttribute.cs
- SqlUdtInfo.cs
- DataRelationPropertyDescriptor.cs
- Vector.cs
- XAMLParseException.cs
- SqlDataSourceAdvancedOptionsForm.cs
- NamespaceExpr.cs
- Control.cs
- SqlMultiplexer.cs
- RawMouseInputReport.cs
- TaskFormBase.cs
- XsdValidatingReader.cs
- Vector3DIndependentAnimationStorage.cs
- COM2EnumConverter.cs
- DbSetClause.cs
- IdSpace.cs
- WindowsListViewScroll.cs
- ConsoleCancelEventArgs.cs
- CodeAccessPermission.cs
- OwnerDrawPropertyBag.cs
- CommandHelpers.cs
- UIElement3DAutomationPeer.cs
- ExpressionEditorAttribute.cs
- CryptographicAttribute.cs
- ProjectionPruner.cs
- SqlUserDefinedTypeAttribute.cs
- XmlTextEncoder.cs
- ExceptionHandlerDesigner.cs
- DetailsView.cs
- WebPartEditorCancelVerb.cs
- LostFocusEventManager.cs
- ApplicationException.cs
- DocumentPageTextView.cs
- TranslateTransform3D.cs
- WindowPattern.cs
- TreeViewCancelEvent.cs
- NativeMethods.cs
- OutputWindow.cs
- NoClickablePointException.cs
- WindowsGraphicsWrapper.cs
- Material.cs
- MediaContext.cs
- ValidationErrorCollection.cs
- ServiceOperationListItem.cs
- XD.cs
- TypeSemantics.cs
- XamlSerializerUtil.cs
- ShimAsPublicXamlType.cs
- SafeCoTaskMem.cs
- XpsFontSubsetter.cs
- CancellationHandlerDesigner.cs
- Inflater.cs
- HttpHostedTransportConfiguration.cs
- DocumentSequence.cs
- EpmContentSerializer.cs
- LineServices.cs
- SamlAudienceRestrictionCondition.cs
- SqlParameterizer.cs
- GestureRecognizer.cs
- DesignerGeometryHelper.cs
- XmlCustomFormatter.cs
- UrlPath.cs
- RuntimeWrappedException.cs
- DragEvent.cs
- FlowDocumentPageViewerAutomationPeer.cs
- LineServices.cs
- HttpCapabilitiesBase.cs
- ObjectTag.cs
- DataListCommandEventArgs.cs
- PartialCachingControl.cs
- XmlSchemaSimpleTypeList.cs
- WebPartConnectionsEventArgs.cs
- DomainConstraint.cs
- IgnoreFlushAndCloseStream.cs
- ExtenderControl.cs
- ModelTreeEnumerator.cs
- SrgsDocumentParser.cs
- DrawingCollection.cs
- PublisherIdentityPermission.cs
- GroupLabel.cs