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
- XmlSchemaObjectTable.cs
- ToolStripContainerDesigner.cs
- XmlSchemaException.cs
- VSWCFServiceContractGenerator.cs
- ScriptControlDescriptor.cs
- RadioButtonBaseAdapter.cs
- DataControlFieldCollection.cs
- LogWriteRestartAreaState.cs
- SharedDp.cs
- SqlHelper.cs
- TextElement.cs
- ApplicationContext.cs
- WbmpConverter.cs
- DynamicRenderer.cs
- ResourceDictionary.cs
- ToolStripScrollButton.cs
- SecurityBindingElementImporter.cs
- TextMarkerSource.cs
- SchemaNames.cs
- ProviderUtil.cs
- CompilationLock.cs
- AccessKeyManager.cs
- AutoGeneratedFieldProperties.cs
- DecoderNLS.cs
- ContextDataSourceContextData.cs
- SamlAuthorizationDecisionClaimResource.cs
- InputLangChangeEvent.cs
- UserPersonalizationStateInfo.cs
- ExceptionCollection.cs
- FrameworkContentElement.cs
- ToolTipService.cs
- PageCodeDomTreeGenerator.cs
- SafeUserTokenHandle.cs
- JoinCqlBlock.cs
- ProjectionPlanCompiler.cs
- FormatConvertedBitmap.cs
- PriorityItem.cs
- FieldNameLookup.cs
- ImpersonationContext.cs
- SrgsToken.cs
- ToolStripItemRenderEventArgs.cs
- WorkerRequest.cs
- ColorConverter.cs
- SafeNativeMethodsOther.cs
- DataListCommandEventArgs.cs
- SelectedDatesCollection.cs
- XmlSchemaValidationException.cs
- DataGridViewElement.cs
- UriTemplatePathSegment.cs
- XmlProcessingInstruction.cs
- ObjectAnimationUsingKeyFrames.cs
- DataSourceDesigner.cs
- Item.cs
- TabPage.cs
- FixedPageStructure.cs
- WizardForm.cs
- DataGridViewEditingControlShowingEventArgs.cs
- TextEditorContextMenu.cs
- WebPartCollection.cs
- MessageQueueException.cs
- PathSegmentCollection.cs
- ObjectDataSourceFilteringEventArgs.cs
- PartitionedDataSource.cs
- DSASignatureFormatter.cs
- DataGridTextBox.cs
- TemplateBindingExpressionConverter.cs
- CmsInterop.cs
- BrushValueSerializer.cs
- ResXResourceSet.cs
- TreeBuilder.cs
- ScriptingScriptResourceHandlerSection.cs
- CatalogZoneBase.cs
- SqlInternalConnectionTds.cs
- MouseGestureValueSerializer.cs
- DatatypeImplementation.cs
- RecordBuilder.cs
- UInt32Converter.cs
- Preprocessor.cs
- SqlDataReaderSmi.cs
- AnnotationResource.cs
- SolidColorBrush.cs
- AuthenticationSection.cs
- ReadOnlyDataSource.cs
- ContentWrapperAttribute.cs
- MessageContractImporter.cs
- MemberDomainMap.cs
- UIPropertyMetadata.cs
- _SecureChannel.cs
- CodeExporter.cs
- QilChoice.cs
- DivideByZeroException.cs
- ParameterSubsegment.cs
- OdbcEnvironment.cs
- DeploymentSectionCache.cs
- PropertyEntry.cs
- SchemaImporter.cs
- OpenTypeLayoutCache.cs
- TypeGeneratedEventArgs.cs
- BitmapEffectGeneralTransform.cs
- HyperLinkColumn.cs