Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 2 / 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
- StringWriter.cs
- AbstractDataSvcMapFileLoader.cs
- CodeTypeReference.cs
- ChannelFactory.cs
- Control.cs
- GridViewCancelEditEventArgs.cs
- DescendantBaseQuery.cs
- CommandArguments.cs
- TextTreeText.cs
- nulltextnavigator.cs
- StreamedWorkflowDefinitionContext.cs
- DeferredTextReference.cs
- BamlLocalizableResource.cs
- DataGridState.cs
- DataSourceView.cs
- _SafeNetHandles.cs
- RuleElement.cs
- WeakHashtable.cs
- ScrollProviderWrapper.cs
- TablePattern.cs
- WebConfigManager.cs
- WebPartTracker.cs
- CreateUserErrorEventArgs.cs
- CollectionTypeElement.cs
- SessionViewState.cs
- SQLBinaryStorage.cs
- BaseParaClient.cs
- BinaryConverter.cs
- AdCreatedEventArgs.cs
- Viewport3DVisual.cs
- CodeCatchClauseCollection.cs
- ClientSponsor.cs
- GroupBoxRenderer.cs
- ProviderException.cs
- LicenseManager.cs
- FormsAuthenticationEventArgs.cs
- ParallelQuery.cs
- IssuanceLicense.cs
- RTLAwareMessageBox.cs
- ValidationSummary.cs
- SecurityUtils.cs
- PartialCachingAttribute.cs
- GroupBox.cs
- PanelStyle.cs
- TdsRecordBufferSetter.cs
- CompilationSection.cs
- Rule.cs
- OperationContextScope.cs
- KeyFrames.cs
- StandardOleMarshalObject.cs
- ServiceOperationViewControl.cs
- PanningMessageFilter.cs
- ProgressiveCrcCalculatingStream.cs
- ReturnEventArgs.cs
- _NtlmClient.cs
- TypeConverters.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ToolStripLabel.cs
- StylusDownEventArgs.cs
- RawStylusInput.cs
- TypeToken.cs
- SoapTransportImporter.cs
- SafeNativeMethods.cs
- FilterableAttribute.cs
- FileRecordSequenceHelper.cs
- GradientBrush.cs
- Double.cs
- NameScope.cs
- Vector3DKeyFrameCollection.cs
- Timer.cs
- PluggableProtocol.cs
- CodeDomExtensionMethods.cs
- _SSPIWrapper.cs
- NoneExcludedImageIndexConverter.cs
- VisualTransition.cs
- PathParser.cs
- ConditionedDesigner.cs
- UdpTransportSettings.cs
- ConsoleCancelEventArgs.cs
- TextBoxBase.cs
- ApplicationId.cs
- ScriptMethodAttribute.cs
- ExpressionSelection.cs
- _ShellExpression.cs
- BitStack.cs
- FontWeight.cs
- WindowsComboBox.cs
- FragmentQuery.cs
- ApplicationInfo.cs
- storepermissionattribute.cs
- PackageStore.cs
- ResourcePermissionBase.cs
- DictionaryBase.cs
- AddInAttribute.cs
- DataSetUtil.cs
- DataServiceConfiguration.cs
- ClientEventManager.cs
- XmlTextEncoder.cs
- Brushes.cs
- Subtree.cs