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
- PrimarySelectionAdorner.cs
- TransformerInfo.cs
- DataBinding.cs
- ComplusEndpointConfigContainer.cs
- DebuggerAttributes.cs
- ThrowHelper.cs
- WindowsStatic.cs
- Signature.cs
- DataControlFieldHeaderCell.cs
- SafeViewOfFileHandle.cs
- RequestCachingSection.cs
- RankException.cs
- TimeSpanMinutesConverter.cs
- SelectionWordBreaker.cs
- SqlBinder.cs
- DataColumnChangeEvent.cs
- PrintPreviewGraphics.cs
- CodeMethodReturnStatement.cs
- QueryOutputWriter.cs
- CommunicationObjectAbortedException.cs
- AssemblyName.cs
- BinaryObjectInfo.cs
- XComponentModel.cs
- WindowsClaimSet.cs
- XmlExtensionFunction.cs
- DataSourceSerializationException.cs
- RepeaterItemEventArgs.cs
- RequestCacheValidator.cs
- XPathPatternBuilder.cs
- RelationshipConstraintValidator.cs
- ObjectDataProvider.cs
- SymmetricAlgorithm.cs
- ThemeInfoAttribute.cs
- SoapHeader.cs
- InternalControlCollection.cs
- GifBitmapEncoder.cs
- GPRECT.cs
- x509store.cs
- SortKey.cs
- Action.cs
- DateBoldEvent.cs
- HandlerBase.cs
- BitmapDownload.cs
- CodeAttributeDeclaration.cs
- EdmToObjectNamespaceMap.cs
- ResourceIDHelper.cs
- FlowDocumentFormatter.cs
- MultiSelectRootGridEntry.cs
- HtmlInputImage.cs
- ComponentChangedEvent.cs
- XmlUTF8TextWriter.cs
- DynamicQueryableWrapper.cs
- XmlSchemaCompilationSettings.cs
- Group.cs
- FileDialog.cs
- ReadContentAsBinaryHelper.cs
- AnimationStorage.cs
- WriteStateInfoBase.cs
- Attachment.cs
- ObjectCacheHost.cs
- HttpRequestBase.cs
- RowSpanVector.cs
- ClientEventManager.cs
- CheckBoxBaseAdapter.cs
- FontFaceLayoutInfo.cs
- DragDeltaEventArgs.cs
- Exceptions.cs
- SqlErrorCollection.cs
- EditorPartChrome.cs
- XmlWrappingReader.cs
- SafeSecurityHandles.cs
- followingsibling.cs
- Tool.cs
- IsolatedStoragePermission.cs
- NamespaceListProperty.cs
- TailCallAnalyzer.cs
- updateconfighost.cs
- DbParameterCollection.cs
- DataGridPagerStyle.cs
- SqlBulkCopy.cs
- StateMachineSubscriptionManager.cs
- DispatchRuntime.cs
- FileEnumerator.cs
- GradientBrush.cs
- SetStateEventArgs.cs
- Codec.cs
- NavigationPropertyEmitter.cs
- InputReferenceExpression.cs
- DataBoundControl.cs
- TransformCollection.cs
- TextSearch.cs
- InputManager.cs
- _SSPIWrapper.cs
- UnicodeEncoding.cs
- RegexGroupCollection.cs
- Instrumentation.cs
- DataGridViewControlCollection.cs
- SHA256Managed.cs
- TimeIntervalCollection.cs
- RepeaterItem.cs