Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1305376 / 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
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TreeViewEvent.cs
- DetailsViewCommandEventArgs.cs
- RectAnimationClockResource.cs
- SessionConnectionReader.cs
- BigInt.cs
- ZipIOCentralDirectoryBlock.cs
- OdbcFactory.cs
- Brush.cs
- DataGridCommandEventArgs.cs
- CodeObjectCreateExpression.cs
- XMLUtil.cs
- ResourcePool.cs
- MemberNameValidator.cs
- SettingsSavedEventArgs.cs
- TerminateSequenceResponse.cs
- BaseCAMarshaler.cs
- SizeConverter.cs
- Crc32.cs
- CatalogZoneAutoFormat.cs
- Flowchart.cs
- Repeater.cs
- StyleCollectionEditor.cs
- AsymmetricKeyExchangeFormatter.cs
- CreateParams.cs
- XmlText.cs
- ForeignKeyConstraint.cs
- IPAddressCollection.cs
- UserControlParser.cs
- X509ServiceCertificateAuthenticationElement.cs
- QilNode.cs
- DefaultValueConverter.cs
- XmlObjectSerializerContext.cs
- ColorDialog.cs
- StringComparer.cs
- BuilderPropertyEntry.cs
- SingleObjectCollection.cs
- UriSectionData.cs
- X509Utils.cs
- ColumnTypeConverter.cs
- PreloadedPackages.cs
- TimeSpanSecondsConverter.cs
- XmlSchemaAttributeGroupRef.cs
- OrderByQueryOptionExpression.cs
- EffectiveValueEntry.cs
- ListManagerBindingsCollection.cs
- GroupBoxAutomationPeer.cs
- Tokenizer.cs
- CodeActivityContext.cs
- GridViewUpdateEventArgs.cs
- NamedPermissionSet.cs
- AtomParser.cs
- mda.cs
- HandlerFactoryWrapper.cs
- DecoderNLS.cs
- DaylightTime.cs
- ObservableCollection.cs
- ellipse.cs
- Guid.cs
- InvokeMethod.cs
- MaterialGroup.cs
- Conditional.cs
- SafeSystemMetrics.cs
- Task.cs
- SelectionEditor.cs
- OrderedDictionary.cs
- _NTAuthentication.cs
- AppDomainProtocolHandler.cs
- ValidationSummary.cs
- DbParameterCollection.cs
- BitmapEffectInputData.cs
- XPathPatternBuilder.cs
- ListViewItem.cs
- ParameterExpression.cs
- SqlAliaser.cs
- Int64Converter.cs
- PlainXmlWriter.cs
- EntitySetBaseCollection.cs
- ServiceParser.cs
- DataObjectCopyingEventArgs.cs
- XPathArrayIterator.cs
- NamedPipeChannelFactory.cs
- SqlDataAdapter.cs
- followingsibling.cs
- DefinitionUpdate.cs
- AssemblyContextControlItem.cs
- GroupStyle.cs
- CodeGenHelper.cs
- WpfWebRequestHelper.cs
- InternalConfigSettingsFactory.cs
- TargetPerspective.cs
- PieceDirectory.cs
- PathSegmentCollection.cs
- Compiler.cs
- DataGridViewDataErrorEventArgs.cs
- DocumentViewerAutomationPeer.cs
- Thread.cs
- OpCodes.cs
- ColorDialog.cs
- FlowLayoutPanel.cs
- Int16Storage.cs