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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeAttributeDeclaration.cs
- SqlLiftWhereClauses.cs
- DefaultBindingPropertyAttribute.cs
- BaseCodePageEncoding.cs
- ExtenderControl.cs
- RegisteredHiddenField.cs
- Function.cs
- SafeNativeMethods.cs
- Pen.cs
- TreeBuilderXamlTranslator.cs
- WmlValidatorAdapter.cs
- VectorCollection.cs
- PackageFilter.cs
- EnvironmentPermission.cs
- MouseActionConverter.cs
- GenericsNotImplementedException.cs
- SpecialFolderEnumConverter.cs
- PTUtility.cs
- UnsafeNativeMethods.cs
- Int32.cs
- SkipQueryOptionExpression.cs
- RuntimeConfigLKG.cs
- DropDownList.cs
- StrokeNode.cs
- MimeMapping.cs
- StaticSiteMapProvider.cs
- AxHost.cs
- ListManagerBindingsCollection.cs
- TextServicesDisplayAttribute.cs
- XmlTextReaderImpl.cs
- ChannelBinding.cs
- TextBox.cs
- ObjectNotFoundException.cs
- WebPartsPersonalization.cs
- ImmutableObjectAttribute.cs
- JsonReaderDelegator.cs
- OleDbWrapper.cs
- MembershipValidatePasswordEventArgs.cs
- pingexception.cs
- WsatAdminException.cs
- ListItemConverter.cs
- LayoutUtils.cs
- CustomError.cs
- Int16.cs
- Speller.cs
- NullableConverter.cs
- WebSysDefaultValueAttribute.cs
- Gdiplus.cs
- bidPrivateBase.cs
- SQLInt64Storage.cs
- DbConnectionPoolCounters.cs
- SoapProtocolReflector.cs
- SourceLocation.cs
- PrtCap_Base.cs
- XmlEventCache.cs
- IODescriptionAttribute.cs
- CodeLabeledStatement.cs
- Base64Stream.cs
- PropertyValueChangedEvent.cs
- HttpSessionStateWrapper.cs
- WindowsIPAddress.cs
- BrowserInteropHelper.cs
- DesignerTransactionCloseEvent.cs
- XmlObjectSerializer.cs
- OdbcCommandBuilder.cs
- GradientStop.cs
- ConfigurationSettings.cs
- FlowDocumentScrollViewer.cs
- XmlSchemaSimpleContent.cs
- AccessKeyManager.cs
- GenericUriParser.cs
- PrefixQName.cs
- ResolveNameEventArgs.cs
- PenLineCapValidation.cs
- DataViewSetting.cs
- TextTreeNode.cs
- DbReferenceCollection.cs
- MetadataUtil.cs
- PreviewKeyDownEventArgs.cs
- PageFunction.cs
- BuilderPropertyEntry.cs
- ActivationArguments.cs
- WebPartEditorApplyVerb.cs
- IndicShape.cs
- ManipulationStartedEventArgs.cs
- DesignerVerbToolStripMenuItem.cs
- ColumnPropertiesGroup.cs
- CompositeDuplexBindingElementImporter.cs
- TailPinnedEventArgs.cs
- HandlerWithFactory.cs
- WorkflowDesignerMessageFilter.cs
- QuaternionAnimationBase.cs
- InternalPermissions.cs
- Emitter.cs
- HttpApplicationFactory.cs
- CryptoConfig.cs
- ContextBase.cs
- DelegateBodyWriter.cs
- ClientApiGenerator.cs
- WebHostedComPlusServiceHost.cs