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
- CustomPeerResolverService.cs
- AssociationTypeEmitter.cs
- DataGridViewHitTestInfo.cs
- LoginCancelEventArgs.cs
- MsmqAppDomainProtocolHandler.cs
- PropertyDescriptors.cs
- SqlTransaction.cs
- NamedPipeProcessProtocolHandler.cs
- WindowsStartMenu.cs
- DbConnectionOptions.cs
- CopyOnWriteList.cs
- UIElementParaClient.cs
- FontResourceCache.cs
- XmlElementAttribute.cs
- __Error.cs
- TabControlDesigner.cs
- EventRoute.cs
- FocusChangedEventArgs.cs
- Claim.cs
- FrameworkElementFactory.cs
- AttachedPropertyMethodSelector.cs
- __Filters.cs
- JournalEntryStack.cs
- XmlNavigatorFilter.cs
- COM2PropertyBuilderUITypeEditor.cs
- TextAction.cs
- RelationshipDetailsCollection.cs
- SmiEventSink_DeferedProcessing.cs
- TrackingRecord.cs
- DataServiceException.cs
- IdentityManager.cs
- AutomationProperties.cs
- ThreadExceptionDialog.cs
- PanelStyle.cs
- OperationPerformanceCounters.cs
- PasswordPropertyTextAttribute.cs
- IntegerValidatorAttribute.cs
- PrinterUnitConvert.cs
- StyleTypedPropertyAttribute.cs
- SQLBytes.cs
- UserNameSecurityTokenProvider.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- BamlBinaryWriter.cs
- Schema.cs
- DbConnectionPoolOptions.cs
- UIPermission.cs
- ProviderConnectionPointCollection.cs
- TypeRefElement.cs
- GeometryGroup.cs
- SigningCredentials.cs
- ConfigurationPermission.cs
- UnsafeNativeMethods.cs
- CustomExpression.cs
- PkcsUtils.cs
- ProfileSection.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ObjectItemCollection.cs
- SqlParameterCollection.cs
- Exceptions.cs
- RelatedCurrencyManager.cs
- SystemDiagnosticsSection.cs
- StreamReader.cs
- GridItem.cs
- MetadataItem_Static.cs
- PixelFormat.cs
- ListenerAdapter.cs
- ColorMap.cs
- CodeSnippetExpression.cs
- AxWrapperGen.cs
- TogglePatternIdentifiers.cs
- Rotation3DKeyFrameCollection.cs
- SqlBuilder.cs
- QueryCacheManager.cs
- SchemaEntity.cs
- ColumnResizeUndoUnit.cs
- CheckBoxRenderer.cs
- ComponentResourceKeyConverter.cs
- AsyncResult.cs
- DirectionalLight.cs
- FileDialogCustomPlaces.cs
- ProjectionCamera.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- TextParagraphProperties.cs
- ClientReliableChannelBinder.cs
- DefaultTraceListener.cs
- unitconverter.cs
- DeleteWorkflowOwnerCommand.cs
- FontFamilyConverter.cs
- InputLanguageCollection.cs
- AssemblyHash.cs
- QilNode.cs
- ContextMenuService.cs
- TypeNameConverter.cs
- DocumentPage.cs
- XmlCollation.cs
- TokenBasedSet.cs
- SafeNativeMethodsMilCoreApi.cs
- GroupBox.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- SkipStoryboardToFill.cs