Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1 / PropertyItemInternal.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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
- TcpWorkerProcess.cs
- CookielessHelper.cs
- MetadataPropertyvalue.cs
- CodeGenerator.cs
- IconBitmapDecoder.cs
- GPPOINT.cs
- Int32AnimationUsingKeyFrames.cs
- OleDbError.cs
- CorruptingExceptionCommon.cs
- CoreSwitches.cs
- TemplateColumn.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- WebExceptionStatus.cs
- MimeObjectFactory.cs
- DbConnectionStringBuilder.cs
- ISO2022Encoding.cs
- WindowsListViewScroll.cs
- AmbiguousMatchException.cs
- WindowsScroll.cs
- StrokeRenderer.cs
- ViewStateException.cs
- SettingsAttributes.cs
- BigInt.cs
- WebServiceTypeData.cs
- AudioSignalProblemOccurredEventArgs.cs
- ClrPerspective.cs
- IdentifierCollection.cs
- TextServicesPropertyRanges.cs
- Deflater.cs
- PropertyItem.cs
- ImageMapEventArgs.cs
- Triplet.cs
- CompilerGeneratedAttribute.cs
- CodeTypeReferenceCollection.cs
- ValidationRuleCollection.cs
- ProfileInfo.cs
- Msmq4PoisonHandler.cs
- DiscoveryReferences.cs
- DataGridHeaderBorder.cs
- TypefaceMetricsCache.cs
- QuaternionAnimationBase.cs
- CngKeyBlobFormat.cs
- ErrorFormatter.cs
- InlinedAggregationOperatorEnumerator.cs
- BitmapEffectvisualstate.cs
- input.cs
- HttpCookie.cs
- WorkflowTraceTransfer.cs
- ConstructorExpr.cs
- MenuItemCollection.cs
- GenericWebPart.cs
- RequiredAttributeAttribute.cs
- ListSourceHelper.cs
- BuildManager.cs
- CompleteWizardStep.cs
- XmlImplementation.cs
- FrameworkElementAutomationPeer.cs
- IMembershipProvider.cs
- WizardForm.cs
- HostProtectionPermission.cs
- WebAdminConfigurationHelper.cs
- ProgressBar.cs
- ByteAnimationUsingKeyFrames.cs
- EasingKeyFrames.cs
- EntityCommandDefinition.cs
- FormatControl.cs
- StaticDataManager.cs
- ListViewInsertedEventArgs.cs
- ParseHttpDate.cs
- KnownColorTable.cs
- CacheHelper.cs
- CompoundFileStorageReference.cs
- DataMember.cs
- BooleanExpr.cs
- ClientTargetSection.cs
- TableCellAutomationPeer.cs
- XmlCustomFormatter.cs
- ClientTargetCollection.cs
- LoginViewDesigner.cs
- InputScopeNameConverter.cs
- DataPagerFieldCollection.cs
- PrintPreviewGraphics.cs
- ZipIOLocalFileHeader.cs
- DataGridViewIntLinkedList.cs
- ThicknessAnimationBase.cs
- BooleanFacetDescriptionElement.cs
- GenericTypeParameterConverter.cs
- DataRow.cs
- BaseTemplateCodeDomTreeGenerator.cs
- StyleXamlTreeBuilder.cs
- PingReply.cs
- PeerValidationBehavior.cs
- EditorBrowsableAttribute.cs
- DecimalKeyFrameCollection.cs
- Compensate.cs
- CallTemplateAction.cs
- XmlIlTypeHelper.cs
- InProcStateClientManager.cs
- LinqDataSourceDeleteEventArgs.cs
- CLSCompliantAttribute.cs