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
- PrintingPermissionAttribute.cs
- Bits.cs
- SelectedDatesCollection.cs
- DPCustomTypeDescriptor.cs
- LinqDataSourceDeleteEventArgs.cs
- DecoderReplacementFallback.cs
- Stack.cs
- ConfigXmlComment.cs
- AutomationAttributeInfo.cs
- _LoggingObject.cs
- StatusBarDrawItemEvent.cs
- AsymmetricCryptoHandle.cs
- VectorAnimationBase.cs
- CurrencyManager.cs
- ClientSideQueueItem.cs
- HttpStreamMessage.cs
- TypeConverter.cs
- ConstructorNeedsTagAttribute.cs
- configsystem.cs
- CardSpaceSelector.cs
- XmlSchemaSimpleTypeList.cs
- ApplicationHost.cs
- WSHttpBindingCollectionElement.cs
- ContextMarshalException.cs
- counter.cs
- VisualTreeHelper.cs
- FixedSOMElement.cs
- RawStylusSystemGestureInputReport.cs
- WorkflowItemPresenter.cs
- ContentValidator.cs
- HttpValueCollection.cs
- WebPartUtil.cs
- UserControlParser.cs
- PreviewPrintController.cs
- ConditionalAttribute.cs
- WebPart.cs
- AssociationSetEnd.cs
- TextSpan.cs
- ExpressionEvaluator.cs
- RSAPKCS1KeyExchangeFormatter.cs
- unsafenativemethodstextservices.cs
- CloseSequenceResponse.cs
- CodeCompileUnit.cs
- BinHexEncoder.cs
- PageBorderless.cs
- TypeInfo.cs
- ProfilePropertySettingsCollection.cs
- CodeDirectoryCompiler.cs
- SwitchAttribute.cs
- XsltInput.cs
- _LocalDataStore.cs
- HttpCachePolicy.cs
- CuspData.cs
- ProviderConnectionPointCollection.cs
- GroupJoinQueryOperator.cs
- TableLayoutPanelDesigner.cs
- ObjectDataSourceChooseTypePanel.cs
- UnmanagedMemoryStreamWrapper.cs
- TextTreeExtractElementUndoUnit.cs
- Mappings.cs
- ScriptManagerProxy.cs
- LocalizableAttribute.cs
- HashHelper.cs
- ConfigurationManagerHelperFactory.cs
- OdbcParameterCollection.cs
- XmlTypeMapping.cs
- AuthenticatedStream.cs
- SqlError.cs
- ResourceDisplayNameAttribute.cs
- WindowsTitleBar.cs
- ImageDesigner.cs
- DispatcherOperation.cs
- BlurEffect.cs
- DataService.cs
- PtsContext.cs
- EventLogTraceListener.cs
- SourceFilter.cs
- DNS.cs
- XPathDocumentIterator.cs
- SafeCryptContextHandle.cs
- DataGridRow.cs
- iisPickupDirectory.cs
- SystemEvents.cs
- PeerPresenceInfo.cs
- XmlSchemaAny.cs
- XmlJsonWriter.cs
- ExpressionBuilder.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- IncrementalReadDecoders.cs
- MailWebEventProvider.cs
- DoubleStorage.cs
- DBSchemaRow.cs
- parserscommon.cs
- RepeatBehaviorConverter.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- Base64Decoder.cs
- GatewayIPAddressInformationCollection.cs
- RepeaterItem.cs
- ConnectionStringSettingsCollection.cs
- Int32.cs