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
- GridView.cs
- TypeDescriptionProviderAttribute.cs
- GetWinFXPath.cs
- SimpleWorkerRequest.cs
- SafeCertificateContext.cs
- AndCondition.cs
- MethodExecutor.cs
- DataShape.cs
- SqlUDTStorage.cs
- HttpChannelBindingToken.cs
- Block.cs
- BufferedGraphicsManager.cs
- StreamReader.cs
- WebBrowser.cs
- GridProviderWrapper.cs
- BrowserTree.cs
- UniqueSet.cs
- WindowsFormsLinkLabel.cs
- DesignerForm.cs
- ByteRangeDownloader.cs
- WmlTextBoxAdapter.cs
- DependencyObjectProvider.cs
- SingleAnimationBase.cs
- Error.cs
- GenericUriParser.cs
- BitStream.cs
- CqlWriter.cs
- InternalSendMessage.cs
- Events.cs
- PeerMaintainer.cs
- BooleanExpr.cs
- ISO2022Encoding.cs
- SeparatorAutomationPeer.cs
- StrokeCollectionDefaultValueFactory.cs
- MaterialGroup.cs
- WebConfigurationManager.cs
- TTSEvent.cs
- StringInfo.cs
- TransformerTypeCollection.cs
- GlobalAclOperationRequirement.cs
- FixedSOMTextRun.cs
- CallbackValidatorAttribute.cs
- DisplayInformation.cs
- OutputScopeManager.cs
- XmlILTrace.cs
- AccessorTable.cs
- HttpWebRequest.cs
- IgnoreSection.cs
- TimeManager.cs
- TraceHwndHost.cs
- SmtpSection.cs
- NativeMethods.cs
- PersonalizationStateQuery.cs
- SqlDataSourceCache.cs
- PrePrepareMethodAttribute.cs
- Util.cs
- WorkflowPrinting.cs
- SecurityIdentifierElementCollection.cs
- RootCodeDomSerializer.cs
- ButtonBase.cs
- ServicePoint.cs
- ConnectionPoint.cs
- _SslState.cs
- UserPreferenceChangedEventArgs.cs
- Baml2006SchemaContext.cs
- XmlTypeMapping.cs
- ProfileElement.cs
- SystemException.cs
- ParameterReplacerVisitor.cs
- DataKeyArray.cs
- ErrorHandler.cs
- IProducerConsumerCollection.cs
- ObjectStateEntryDbDataRecord.cs
- CodeBinaryOperatorExpression.cs
- WindowsFormsSectionHandler.cs
- SafeCryptoHandles.cs
- RangeContentEnumerator.cs
- InvokeMethodDesigner.xaml.cs
- ImplicitInputBrush.cs
- MessageEventSubscriptionService.cs
- ConfigurationPropertyAttribute.cs
- BoundField.cs
- XmlCustomFormatter.cs
- Filter.cs
- DataGridViewHeaderCell.cs
- CollectionContainer.cs
- XmlQueryTypeFactory.cs
- HashMembershipCondition.cs
- XmlNodeReader.cs
- InternalCache.cs
- designeractionlistschangedeventargs.cs
- DataBindingHandlerAttribute.cs
- EntitySetBaseCollection.cs
- ComplexObject.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ArrayExtension.cs
- CacheMemory.cs
- Size.cs
- LockCookie.cs
- PropertyGridEditorPart.cs