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
- XmlPreloadedResolver.cs
- XmlAttributeCache.cs
- SchemaObjectWriter.cs
- DockPatternIdentifiers.cs
- PrintingPermissionAttribute.cs
- LayoutEditorPart.cs
- UnmanagedMemoryStreamWrapper.cs
- PerspectiveCamera.cs
- ItemDragEvent.cs
- LocalValueEnumerator.cs
- DBCommandBuilder.cs
- XmlDeclaration.cs
- OracleTransaction.cs
- AttributeExtensions.cs
- MediaContextNotificationWindow.cs
- SingleStorage.cs
- MouseWheelEventArgs.cs
- ListView.cs
- PointAnimation.cs
- SettingsAttributes.cs
- MemberDescriptor.cs
- HeaderUtility.cs
- OracleSqlParser.cs
- TraceUtils.cs
- RelatedCurrencyManager.cs
- HttpCookieCollection.cs
- TerminateDesigner.cs
- URLMembershipCondition.cs
- TimeoutException.cs
- CompatibleIComparer.cs
- SearchForVirtualItemEventArgs.cs
- DictionaryManager.cs
- RIPEMD160Managed.cs
- DbProviderFactory.cs
- GridEntryCollection.cs
- FormatterServices.cs
- PropertyCondition.cs
- ObjectStateFormatter.cs
- DataGridViewDataConnection.cs
- ErrorStyle.cs
- RuntimeEnvironment.cs
- RepeaterItemCollection.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- InputScopeNameConverter.cs
- DataGridLinkButton.cs
- MetadataResolver.cs
- FunctionMappingTranslator.cs
- MapPathBasedVirtualPathProvider.cs
- Axis.cs
- DataGridViewTopLeftHeaderCell.cs
- TagMapInfo.cs
- HtmlInputReset.cs
- MenuAdapter.cs
- HtmlInputImage.cs
- AgileSafeNativeMemoryHandle.cs
- PenThreadWorker.cs
- AttachedPropertyBrowsableAttribute.cs
- DelegateInArgument.cs
- SafeNativeMethodsOther.cs
- RelationshipConverter.cs
- SymbolMethod.cs
- DataGridViewButtonColumn.cs
- DataGridViewCellFormattingEventArgs.cs
- ApplicationSecurityInfo.cs
- Inflater.cs
- XmlMtomReader.cs
- ByeMessageCD1.cs
- AssemblyNameProxy.cs
- AnnotationComponentManager.cs
- RegexRunner.cs
- BitmapData.cs
- ListMarkerSourceInfo.cs
- GridViewDeleteEventArgs.cs
- _HeaderInfo.cs
- ScrollBar.cs
- DateTime.cs
- Registry.cs
- Inline.cs
- TimeEnumHelper.cs
- HtmlLinkAdapter.cs
- KeyValuePair.cs
- DefinitionBase.cs
- ScriptBehaviorDescriptor.cs
- InputManager.cs
- XmlWellformedWriter.cs
- PageThemeCodeDomTreeGenerator.cs
- AuthenticatedStream.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- OleDbParameterCollection.cs
- COM2ExtendedTypeConverter.cs
- MenuAdapter.cs
- CodeTypeMember.cs
- ToolStripProgressBar.cs
- GuidTagList.cs
- ArcSegment.cs
- WebAdminConfigurationHelper.cs
- SerializationObjectManager.cs
- Metafile.cs
- XmlHierarchicalDataSourceView.cs
- MetadataSource.cs