Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- InternalConfigSettingsFactory.cs
- UriParserTemplates.cs
- SourceItem.cs
- Panel.cs
- ListMarkerSourceInfo.cs
- SqlFileStream.cs
- OTFRasterizer.cs
- DataGridViewColumnEventArgs.cs
- Empty.cs
- TypeSystemHelpers.cs
- WeakEventManager.cs
- ContentTextAutomationPeer.cs
- CustomGrammar.cs
- ReflectionPermission.cs
- TextEndOfParagraph.cs
- ProcessModelInfo.cs
- InternalConfigConfigurationFactory.cs
- InvalidAsynchronousStateException.cs
- DynamicRendererThreadManager.cs
- Internal.cs
- TrackingRecord.cs
- KerberosSecurityTokenProvider.cs
- ObjectDataSourceFilteringEventArgs.cs
- Byte.cs
- SingleTagSectionHandler.cs
- TemplatePartAttribute.cs
- BitmapCodecInfoInternal.cs
- TextBox.cs
- EncoderExceptionFallback.cs
- BaseDataBoundControl.cs
- PersonalizationProvider.cs
- DomainConstraint.cs
- SchemaTableOptionalColumn.cs
- XPathNavigatorReader.cs
- ObjectIDGenerator.cs
- FileDataSource.cs
- DataListDesigner.cs
- OneToOneMappingSerializer.cs
- AttachedPropertyMethodSelector.cs
- ToolStripPanel.cs
- DataServiceProviderWrapper.cs
- MappingItemCollection.cs
- ManipulationInertiaStartingEventArgs.cs
- EntityConnectionStringBuilder.cs
- SessionStateItemCollection.cs
- SamlSubjectStatement.cs
- IisTraceListener.cs
- TemplateAction.cs
- FormatVersion.cs
- Int32Rect.cs
- XmlSchemaSimpleContentRestriction.cs
- ErrorRuntimeConfig.cs
- FrameworkName.cs
- ProvidersHelper.cs
- PriorityBinding.cs
- UIPropertyMetadata.cs
- FrameworkElementFactory.cs
- View.cs
- GetLastErrorDetailsRequest.cs
- PassportPrincipal.cs
- QuinticEase.cs
- ByteStack.cs
- ItemChangedEventArgs.cs
- SHA1.cs
- ActionFrame.cs
- WebPartConnectionsConnectVerb.cs
- HttpContextServiceHost.cs
- SecureEnvironment.cs
- ConfigXmlDocument.cs
- KeySplineConverter.cs
- CodeDomDecompiler.cs
- GridViewCancelEditEventArgs.cs
- WindowsTitleBar.cs
- TimeStampChecker.cs
- AssertFilter.cs
- SettingsSavedEventArgs.cs
- ParseNumbers.cs
- LinkGrep.cs
- RefreshResponseInfo.cs
- LoadWorkflowByInstanceKeyCommand.cs
- IChannel.cs
- ListItemCollection.cs
- RadioButtonFlatAdapter.cs
- PairComparer.cs
- ProfilePropertyMetadata.cs
- MessageFormatterConverter.cs
- HtmlInputHidden.cs
- Soap11ServerProtocol.cs
- LabelAutomationPeer.cs
- RetrieveVirtualItemEventArgs.cs
- IdentitySection.cs
- WindowsGraphics2.cs
- Propagator.JoinPropagator.cs
- MetadataPropertyAttribute.cs
- DataException.cs
- MainMenu.cs
- DataGridRow.cs
- Rotation3DAnimationBase.cs
- MessageDescription.cs
- FixedSOMElement.cs