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
- QueryContinueDragEventArgs.cs
- RenderData.cs
- RuleInfoComparer.cs
- ReadOnlyAttribute.cs
- KeyTime.cs
- Matrix3DValueSerializer.cs
- PersonalizationStateQuery.cs
- OAVariantLib.cs
- _NegotiateClient.cs
- wmiprovider.cs
- XmlWriterTraceListener.cs
- CssTextWriter.cs
- ChannelEndpointElementCollection.cs
- ImageSourceValueSerializer.cs
- LocalizationComments.cs
- QueuePropertyVariants.cs
- TextEditorMouse.cs
- MultipartContentParser.cs
- ToolStripItemClickedEventArgs.cs
- WindowsToolbarAsMenu.cs
- ObjectTag.cs
- MouseCaptureWithinProperty.cs
- Funcletizer.cs
- HierarchicalDataBoundControl.cs
- DependencyObject.cs
- SqlMethods.cs
- ReverseComparer.cs
- EncodingDataItem.cs
- UserControlCodeDomTreeGenerator.cs
- TargetControlTypeCache.cs
- LongCountAggregationOperator.cs
- EmptyStringExpandableObjectConverter.cs
- ContentPlaceHolderDesigner.cs
- UnsafeNativeMethods.cs
- HttpGetServerProtocol.cs
- MenuItem.cs
- StackOverflowException.cs
- GPStream.cs
- Regex.cs
- SqlDependencyListener.cs
- StorageComplexTypeMapping.cs
- WorkflowQueueInfo.cs
- DebugHandleTracker.cs
- Calendar.cs
- FrameworkTextComposition.cs
- TcpClientChannel.cs
- _ListenerResponseStream.cs
- TreeWalkHelper.cs
- ListBase.cs
- MgmtConfigurationRecord.cs
- CodeFieldReferenceExpression.cs
- SQLChars.cs
- XmlDocument.cs
- ToolStripSeparator.cs
- CollectionContainer.cs
- ObjectQueryState.cs
- SystemPens.cs
- WindowsAuthenticationEventArgs.cs
- WorkflowRuntimeSection.cs
- FrameAutomationPeer.cs
- RowToFieldTransformer.cs
- SystemResources.cs
- SpellerHighlightLayer.cs
- ImageListStreamer.cs
- QuaternionRotation3D.cs
- Event.cs
- Exceptions.cs
- mongolianshape.cs
- XXXInfos.cs
- TargetException.cs
- QuarticEase.cs
- Quad.cs
- BookmarkUndoUnit.cs
- CodeCommentStatementCollection.cs
- PropertyGridEditorPart.cs
- AbandonedMutexException.cs
- TextRangeSerialization.cs
- CalculatedColumn.cs
- SmtpLoginAuthenticationModule.cs
- ObjectFullSpanRewriter.cs
- HtmlGenericControl.cs
- OrderedEnumerableRowCollection.cs
- WebEventTraceProvider.cs
- CookieParameter.cs
- FixedPage.cs
- CheckBoxFlatAdapter.cs
- OleDbConnectionInternal.cs
- DeviceContext2.cs
- SystemFonts.cs
- Enum.cs
- OledbConnectionStringbuilder.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- VirtualizedItemProviderWrapper.cs
- FloatUtil.cs
- ExpressionVisitor.cs
- QilGenerator.cs
- TemplateControlBuildProvider.cs
- SoapElementAttribute.cs
- ExtensionFile.cs
- WebPartManager.cs