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
- TriggerActionCollection.cs
- GlyphingCache.cs
- PropertyToken.cs
- DataGridViewCell.cs
- Roles.cs
- DbParameterCollection.cs
- SafeMILHandle.cs
- SynthesizerStateChangedEventArgs.cs
- AmbientValueAttribute.cs
- CreateUserWizardDesigner.cs
- ResourceReferenceExpressionConverter.cs
- ListViewDeletedEventArgs.cs
- EncryptedKeyIdentifierClause.cs
- Compiler.cs
- Int32Converter.cs
- AttributeConverter.cs
- XmlWhitespace.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ImageSource.cs
- MergeFailedEvent.cs
- EpmCustomContentWriterNodeData.cs
- XamlWriter.cs
- Compensation.cs
- MetafileHeaderWmf.cs
- IsolatedStorageFile.cs
- BatchParser.cs
- PathHelper.cs
- FaultCallbackWrapper.cs
- AxHost.cs
- MatrixAnimationBase.cs
- ConditionBrowserDialog.cs
- RuntimeHandles.cs
- EntryPointNotFoundException.cs
- sqlnorm.cs
- LongMinMaxAggregationOperator.cs
- HttpCookie.cs
- TimeSpanFormat.cs
- WindowsPen.cs
- WebPartAuthorizationEventArgs.cs
- ProfileWorkflowElement.cs
- ToolStrip.cs
- LogWriteRestartAreaState.cs
- DynamicILGenerator.cs
- HtmlControl.cs
- TypeLoadException.cs
- OdbcException.cs
- DataPagerFieldItem.cs
- StylesEditorDialog.cs
- OneOfTypeConst.cs
- VariantWrapper.cs
- HMACSHA1.cs
- IndicFontClient.cs
- TypefaceCollection.cs
- ButtonField.cs
- AuthStoreRoleProvider.cs
- Image.cs
- SignatureHelper.cs
- EventLogException.cs
- _HeaderInfoTable.cs
- WebPartExportVerb.cs
- FontStretches.cs
- DataGridViewElement.cs
- ConfigurationLocation.cs
- ExceptionUtility.cs
- NavigationWindowAutomationPeer.cs
- PartialList.cs
- StateMachineAction.cs
- SemaphoreFullException.cs
- MediaSystem.cs
- OdbcPermission.cs
- PackageDigitalSignature.cs
- TemplateColumn.cs
- BitmapInitialize.cs
- _ProxyChain.cs
- MetricEntry.cs
- MemberPath.cs
- GetPageCompletedEventArgs.cs
- ListBoxItemWrapperAutomationPeer.cs
- TreeBuilder.cs
- DeferredTextReference.cs
- CollectionViewGroupInternal.cs
- BitVector32.cs
- BitVector32.cs
- TokenizerHelper.cs
- _AutoWebProxyScriptEngine.cs
- InstallerTypeAttribute.cs
- GlobalAllocSafeHandle.cs
- EdmError.cs
- CatchBlock.cs
- XmlNullResolver.cs
- RewritingValidator.cs
- XmlRawWriter.cs
- RestClientProxyHandler.cs
- DisplayNameAttribute.cs
- Base64Encoding.cs
- ProxyWebPartConnectionCollection.cs
- COM2PropertyPageUITypeConverter.cs
- Ipv6Element.cs
- Misc.cs
- PeerContact.cs