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
- HtmlTableCell.cs
- ObjectDataSourceFilteringEventArgs.cs
- UrlMappingsModule.cs
- AssertHelper.cs
- DnsPermission.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ThemeDictionaryExtension.cs
- GenericPrincipal.cs
- FixedStringLookup.cs
- FacetDescription.cs
- ManifestSignedXml.cs
- XmlEntityReference.cs
- HwndTarget.cs
- CompoundFileDeflateTransform.cs
- TraceLevelStore.cs
- PropVariant.cs
- DynamicPropertyHolder.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- ProfileSection.cs
- HostedHttpContext.cs
- SmtpNtlmAuthenticationModule.cs
- HMACSHA1.cs
- AccessText.cs
- XmlUrlResolver.cs
- KeyEventArgs.cs
- exports.cs
- DataServiceQuery.cs
- FixedDocumentSequencePaginator.cs
- QueryProcessor.cs
- XPathDocumentBuilder.cs
- RuntimeComponentFilter.cs
- TypeConverterAttribute.cs
- TextTreeUndoUnit.cs
- LockedHandleGlyph.cs
- SortableBindingList.cs
- GridView.cs
- DataGridViewCellValueEventArgs.cs
- SmtpFailedRecipientsException.cs
- DataGridCellItemAutomationPeer.cs
- SQLInt32.cs
- InvocationExpression.cs
- XappLauncher.cs
- ADConnectionHelper.cs
- CacheDependency.cs
- ElementUtil.cs
- TraceUtility.cs
- MD5.cs
- ArrayEditor.cs
- ProbeRequestResponseAsyncResult.cs
- DesignerImageAdapter.cs
- UnsafeNativeMethods.cs
- WSFederationHttpBindingElement.cs
- FormViewModeEventArgs.cs
- XmlObjectSerializer.cs
- HybridDictionary.cs
- CommonDialog.cs
- MachineKey.cs
- LinqDataSourceValidationException.cs
- QilTernary.cs
- Content.cs
- NotCondition.cs
- ForwardPositionQuery.cs
- RichTextBoxAutomationPeer.cs
- ElementFactory.cs
- DataServiceRequest.cs
- ItemsChangedEventArgs.cs
- ContextStaticAttribute.cs
- ReliabilityContractAttribute.cs
- IncrementalReadDecoders.cs
- SmtpMail.cs
- WindowsFont.cs
- UserControl.cs
- MetadataAssemblyHelper.cs
- ActiveDesignSurfaceEvent.cs
- WebPartManagerInternals.cs
- RegionInfo.cs
- ServiceThrottlingElement.cs
- MembershipSection.cs
- SortableBindingList.cs
- XPathItem.cs
- QilReplaceVisitor.cs
- EpmSyndicationContentSerializer.cs
- ConstructorNeedsTagAttribute.cs
- XslException.cs
- DeploymentSectionCache.cs
- TargetInvocationException.cs
- WorkflowDefinitionContext.cs
- StringResourceManager.cs
- PersistStreamTypeWrapper.cs
- MenuScrollingVisibilityConverter.cs
- TextCompositionEventArgs.cs
- WizardStepCollectionEditor.cs
- TreeViewEvent.cs
- IIS7ConfigurationLoader.cs
- LookupBindingPropertiesAttribute.cs
- CompressedStack.cs
- RegularExpressionValidator.cs
- DataGridViewLayoutData.cs
- OLEDB_Util.cs
- StorageAssociationTypeMapping.cs