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
- AppDomainUnloadedException.cs
- FactoryGenerator.cs
- _SslStream.cs
- SafeCoTaskMem.cs
- PreservationFileWriter.cs
- ADMembershipProvider.cs
- ListenerHandler.cs
- ActionFrame.cs
- TraceRecord.cs
- UnmanagedMarshal.cs
- ControlPager.cs
- XmlSchemaSimpleTypeRestriction.cs
- Encoder.cs
- TdsParameterSetter.cs
- FacetChecker.cs
- EmissiveMaterial.cs
- DesignUtil.cs
- UserNamePasswordValidationMode.cs
- BindingGraph.cs
- SiteMapNodeItemEventArgs.cs
- GeneralTransformCollection.cs
- DataRowChangeEvent.cs
- HandleRef.cs
- SerializationException.cs
- IndicCharClassifier.cs
- HtmlTextArea.cs
- followingsibling.cs
- SQLConvert.cs
- DataGridPageChangedEventArgs.cs
- TrackingMemoryStream.cs
- ForceCopyBuildProvider.cs
- LineGeometry.cs
- TimeSpanOrInfiniteValidator.cs
- InkCanvasSelection.cs
- ModuleBuilderData.cs
- SqlHelper.cs
- DoubleCollectionValueSerializer.cs
- ProcessProtocolHandler.cs
- ToolStripDropTargetManager.cs
- HtmlTableCellCollection.cs
- EntityAdapter.cs
- Collection.cs
- HuffmanTree.cs
- RoutedEvent.cs
- MultipartIdentifier.cs
- SchemaElementLookUpTable.cs
- Listbox.cs
- UIElementIsland.cs
- ObjectManager.cs
- Misc.cs
- AttributeCallbackBuilder.cs
- ResourceManager.cs
- ClassHandlersStore.cs
- NavigateEvent.cs
- WebResourceAttribute.cs
- Rotation3DKeyFrameCollection.cs
- SurrogateSelector.cs
- SecurityImpersonationBehavior.cs
- DllNotFoundException.cs
- CoTaskMemHandle.cs
- StaticTextPointer.cs
- IsolatedStorageFileStream.cs
- Compiler.cs
- mda.cs
- ListDataBindEventArgs.cs
- MarginsConverter.cs
- DebugHandleTracker.cs
- LicenseManager.cs
- TransformDescriptor.cs
- ApplicationBuildProvider.cs
- StringValueSerializer.cs
- TabItemWrapperAutomationPeer.cs
- Stack.cs
- Executor.cs
- RowUpdatingEventArgs.cs
- InstanceDataCollectionCollection.cs
- XmlDataFileEditor.cs
- ConfigurationElementProperty.cs
- Match.cs
- BinaryObjectWriter.cs
- UIElementIsland.cs
- LongValidatorAttribute.cs
- Size.cs
- DataGridViewCheckBoxCell.cs
- EventData.cs
- PostBackTrigger.cs
- TraceHwndHost.cs
- basemetadatamappingvisitor.cs
- filewebresponse.cs
- TreeIterator.cs
- Expr.cs
- EdmError.cs
- PnrpPermission.cs
- Boolean.cs
- SqlNotificationRequest.cs
- ToolZone.cs
- SyntaxCheck.cs
- InstanceStore.cs
- StickyNote.cs
- ResourceAttributes.cs