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
- PhotoPrintingIntent.cs
- Module.cs
- XmlSchemaFacet.cs
- CellParagraph.cs
- AnnotationHelper.cs
- StyleHelper.cs
- HwndProxyElementProvider.cs
- WebPartCatalogAddVerb.cs
- SelectingProviderEventArgs.cs
- UICuesEvent.cs
- WebPartActionVerb.cs
- SamlSecurityToken.cs
- GroupDescription.cs
- BrowserCapabilitiesCompiler.cs
- StylusPointPropertyInfo.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- CrossSiteScriptingValidation.cs
- DPTypeDescriptorContext.cs
- WebGetAttribute.cs
- AccessControlEntry.cs
- Part.cs
- LinkClickEvent.cs
- TagMapInfo.cs
- sqlser.cs
- SmiTypedGetterSetter.cs
- Journal.cs
- SafeRightsManagementSessionHandle.cs
- ToolboxItemFilterAttribute.cs
- TextBoxAutomationPeer.cs
- ConsoleTraceListener.cs
- BindingWorker.cs
- SourceInterpreter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XmlSchemas.cs
- WebUtil.cs
- SafeUserTokenHandle.cs
- ConnectivityStatus.cs
- DbSetClause.cs
- DataGrid.cs
- WindowsImpersonationContext.cs
- EventHandlersStore.cs
- URLAttribute.cs
- EndpointAddressElementBase.cs
- FloaterBaseParagraph.cs
- TextAdaptor.cs
- ServiceNameElement.cs
- dbdatarecord.cs
- SqlNode.cs
- PartialClassGenerationTask.cs
- InkPresenter.cs
- WindowExtensionMethods.cs
- SourceInterpreter.cs
- Vector3DConverter.cs
- ScriptControl.cs
- MultiAsyncResult.cs
- ASCIIEncoding.cs
- CodeDomDecompiler.cs
- DbCommandDefinition.cs
- ContractUtils.cs
- NetSectionGroup.cs
- LockedBorderGlyph.cs
- StrokeNodeOperations2.cs
- BooleanStorage.cs
- TreeView.cs
- ScrollViewerAutomationPeer.cs
- WebPartDisplayMode.cs
- CodeAttributeArgumentCollection.cs
- BuildProviderCollection.cs
- CodeNamespace.cs
- ReferenceConverter.cs
- JsonClassDataContract.cs
- TableItemStyle.cs
- EventMetadata.cs
- FlowLayout.cs
- HandlerMappingMemo.cs
- KeyValueInternalCollection.cs
- DesignerForm.cs
- NavigationHelper.cs
- RelationshipManager.cs
- MobileControlBuilder.cs
- Compensation.cs
- ToolStripMenuItemCodeDomSerializer.cs
- TextFormatterHost.cs
- TextChange.cs
- AnnotationStore.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- DiscoveryClient.cs
- SqlMetaData.cs
- MexServiceChannelBuilder.cs
- TimeoutHelper.cs
- FillBehavior.cs
- Sequence.cs
- ProcessModule.cs
- QuadraticEase.cs
- DataSourceViewSchemaConverter.cs
- DecoderNLS.cs
- ClientTargetCollection.cs
- ObjectStorage.cs
- ButtonBase.cs
- IMembershipProvider.cs