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
- MonthCalendar.cs
- AssociatedControlConverter.cs
- Perspective.cs
- DataGridViewCellFormattingEventArgs.cs
- BinaryReader.cs
- _AutoWebProxyScriptEngine.cs
- Attributes.cs
- SettingsContext.cs
- TrackingProfile.cs
- Documentation.cs
- MasterPageBuildProvider.cs
- DispatcherObject.cs
- ObjectTypeMapping.cs
- WrappingXamlSchemaContext.cs
- PrivilegedConfigurationManager.cs
- odbcmetadatacollectionnames.cs
- SizeConverter.cs
- ChineseLunisolarCalendar.cs
- RightNameExpirationInfoPair.cs
- ScriptReferenceEventArgs.cs
- WebServiceResponse.cs
- NetCodeGroup.cs
- ProfileSettings.cs
- DataSourceCacheDurationConverter.cs
- ByteStreamGeometryContext.cs
- XmlSchemaAppInfo.cs
- FilterRepeater.cs
- ConfigurationSchemaErrors.cs
- DesignerResources.cs
- SqlTypesSchemaImporter.cs
- DataStreams.cs
- ExecutionEngineException.cs
- EventLogPermissionEntry.cs
- PostBackOptions.cs
- OdbcDataAdapter.cs
- WebServiceData.cs
- RuntimeConfigLKG.cs
- RepeaterDesigner.cs
- AffineTransform3D.cs
- SevenBitStream.cs
- InkCollectionBehavior.cs
- DefaultMemberAttribute.cs
- Matrix3DStack.cs
- HttpBrowserCapabilitiesBase.cs
- UserControl.cs
- WebPartMenuStyle.cs
- ReaderWriterLockSlim.cs
- OleDbPermission.cs
- DrawingContextWalker.cs
- InstanceCollisionException.cs
- Selector.cs
- UnicodeEncoding.cs
- HostExecutionContextManager.cs
- StringFormat.cs
- FileResponseElement.cs
- MarginCollapsingState.cs
- DbParameterHelper.cs
- KeyMatchBuilder.cs
- Qualifier.cs
- DynamicContractTypeBuilder.cs
- DataControlCommands.cs
- SmtpFailedRecipientsException.cs
- SystemFonts.cs
- CqlBlock.cs
- SecurityTraceRecordHelper.cs
- ListDictionaryInternal.cs
- AdPostCacheSubstitution.cs
- RemoteEndpointMessageProperty.cs
- NullableLongSumAggregationOperator.cs
- SqlStatistics.cs
- RevocationPoint.cs
- UserControlCodeDomTreeGenerator.cs
- Set.cs
- HashHelper.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- AppSecurityManager.cs
- ObjectItemCollection.cs
- RegexInterpreter.cs
- NegotiateStream.cs
- securitycriticaldata.cs
- StrokeNodeOperations2.cs
- BehaviorEditorPart.cs
- CodeGenerator.cs
- AuthenticationSchemesHelper.cs
- DynamicActionMessageFilter.cs
- LockedHandleGlyph.cs
- FrameAutomationPeer.cs
- ConfigurationValidatorBase.cs
- Fonts.cs
- SocketPermission.cs
- BitConverter.cs
- GradientBrush.cs
- TransformValueSerializer.cs
- LoginUtil.cs
- FlowLayout.cs
- TextBoxRenderer.cs
- XmlReader.cs
- XXXOnTypeBuilderInstantiation.cs
- TransactionInterop.cs
- DefaultShape.cs