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
- PasswordPropertyTextAttribute.cs
- FloaterBaseParagraph.cs
- Compilation.cs
- XPathPatternBuilder.cs
- ToolStripContentPanelDesigner.cs
- NodeLabelEditEvent.cs
- WebPartsPersonalization.cs
- OpCodes.cs
- SerializationFieldInfo.cs
- UInt32Storage.cs
- DataControlLinkButton.cs
- FlowLayout.cs
- StringAttributeCollection.cs
- WebPartMovingEventArgs.cs
- Misc.cs
- DataGridViewColumnCollectionDialog.cs
- DisplayInformation.cs
- ConstructorExpr.cs
- WebBrowserNavigatingEventHandler.cs
- regiisutil.cs
- UIElementCollection.cs
- URI.cs
- DebugHandleTracker.cs
- KeyEvent.cs
- FastPropertyAccessor.cs
- ObfuscationAttribute.cs
- Message.cs
- UInt32.cs
- TabItem.cs
- DBNull.cs
- AttachedPropertyBrowsableAttribute.cs
- VerificationAttribute.cs
- BitmapEffectDrawing.cs
- Serializer.cs
- ToolboxDataAttribute.cs
- PartialClassGenerationTask.cs
- Help.cs
- FormsAuthenticationTicket.cs
- EpmSyndicationContentSerializer.cs
- ProxyManager.cs
- MarkupCompiler.cs
- SQLDecimalStorage.cs
- ReferencedAssembly.cs
- HtmlLabelAdapter.cs
- CodeGroup.cs
- _ListenerResponseStream.cs
- StateWorkerRequest.cs
- ParameterBuilder.cs
- DataGridViewCell.cs
- MultipleCopiesCollection.cs
- ApplicationDirectory.cs
- ServiceBusyException.cs
- CustomExpressionEventArgs.cs
- XmlSchemaAppInfo.cs
- InputProviderSite.cs
- Timeline.cs
- ConfigurationPropertyAttribute.cs
- TextServicesProperty.cs
- PeerEndPoint.cs
- StoreAnnotationsMap.cs
- FragmentQueryProcessor.cs
- MappedMetaModel.cs
- UniqueTransportManagerRegistration.cs
- XmlImplementation.cs
- SHA1Managed.cs
- ModelTreeEnumerator.cs
- HashHelper.cs
- TypeTypeConverter.cs
- SectionVisual.cs
- KeyValueSerializer.cs
- MembershipPasswordException.cs
- WmlMobileTextWriter.cs
- ContentOperations.cs
- ThreadStartException.cs
- WindowsAuthenticationEventArgs.cs
- WmlImageAdapter.cs
- SchemaNamespaceManager.cs
- counter.cs
- Int32Storage.cs
- EditorPart.cs
- VectorCollection.cs
- StringReader.cs
- cookie.cs
- ImportContext.cs
- OleDbMetaDataFactory.cs
- BindingSource.cs
- TagPrefixCollection.cs
- SmiMetaDataProperty.cs
- HtmlMeta.cs
- DownloadProgressEventArgs.cs
- ConversionHelper.cs
- DataGridViewCellValidatingEventArgs.cs
- XD.cs
- HttpCapabilitiesSectionHandler.cs
- AppSettingsExpressionBuilder.cs
- PasswordPropertyTextAttribute.cs
- FontFamily.cs
- CodeStatementCollection.cs
- XsdDataContractImporter.cs
- fixedPageContentExtractor.cs