Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1 / PropertyItemInternal.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /*************************************************************************\ * * Copyright (c) 1998-1999, Microsoft Corp. All Rights Reserved. * * Module Name: * * PropertyItem.cs * * Abstract: * * Native GDI+ PropertyItem structure. * * Revision History: * * 3/3/2k [....] * Created it. * \**************************************************************************/ 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
- MatrixAnimationUsingPath.cs
- xmlNames.cs
- VerificationAttribute.cs
- SQLInt32.cs
- FixedSOMGroup.cs
- CodeTypeConstructor.cs
- SystemDiagnosticsSection.cs
- StorageEntityContainerMapping.cs
- ManifestBasedResourceGroveler.cs
- AutomationPropertyInfo.cs
- AssemblyAttributesGoHere.cs
- DSACryptoServiceProvider.cs
- BuildDependencySet.cs
- XmlCountingReader.cs
- RegexRunner.cs
- Convert.cs
- ForceCopyBuildProvider.cs
- RuntimeHelpers.cs
- Console.cs
- ConnectionManagementElementCollection.cs
- InstanceOwnerException.cs
- BufferBuilder.cs
- BamlLocalizableResourceKey.cs
- RegexCompilationInfo.cs
- ViewBox.cs
- CompilerErrorCollection.cs
- PackWebRequest.cs
- SqlBulkCopy.cs
- Pair.cs
- PageSetupDialog.cs
- CodeIdentifiers.cs
- CollectionContainer.cs
- propertytag.cs
- TargetConverter.cs
- HtmlTableCellCollection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- CounterCreationData.cs
- SpecialFolderEnumConverter.cs
- ToolboxItemSnapLineBehavior.cs
- DbConnectionStringCommon.cs
- InstanceLockQueryResult.cs
- RSAOAEPKeyExchangeDeformatter.cs
- SqlTransaction.cs
- DataGridCommandEventArgs.cs
- FunctionParameter.cs
- Margins.cs
- XmlWriterTraceListener.cs
- X509ScopedServiceCertificateElementCollection.cs
- HtmlHistory.cs
- UserControl.cs
- DataControlFieldCell.cs
- RichTextBoxAutomationPeer.cs
- TextBreakpoint.cs
- XmlDataImplementation.cs
- WCFServiceClientProxyGenerator.cs
- WpfWebRequestHelper.cs
- MapPathBasedVirtualPathProvider.cs
- MsmqAppDomainProtocolHandler.cs
- StackSpiller.Bindings.cs
- ApplicationSecurityManager.cs
- LineProperties.cs
- LabelAutomationPeer.cs
- Graph.cs
- TraceListeners.cs
- MultipleViewProviderWrapper.cs
- ProxyGenerator.cs
- FontStretchConverter.cs
- FileDialogPermission.cs
- TypedAsyncResult.cs
- ParallelTimeline.cs
- Pens.cs
- HitTestDrawingContextWalker.cs
- PointKeyFrameCollection.cs
- Animatable.cs
- ToolbarAUtomationPeer.cs
- HwndSourceParameters.cs
- DynamicDocumentPaginator.cs
- SvcFileManager.cs
- SqlUserDefinedAggregateAttribute.cs
- HMAC.cs
- AnnotationStore.cs
- BoolExpressionVisitors.cs
- Camera.cs
- RsaSecurityTokenParameters.cs
- TimeSpanFormat.cs
- SchemaImporterExtensionsSection.cs
- SchemaImporterExtensionsSection.cs
- ExpressionContext.cs
- CachedPathData.cs
- InputDevice.cs
- TypeConverterHelper.cs
- SafeSystemMetrics.cs
- EllipseGeometry.cs
- OverflowException.cs
- WorkflowItemsPresenter.cs
- ValueConversionAttribute.cs
- ResourceManager.cs
- CookielessHelper.cs
- NavigateEvent.cs
- HtmlControlPersistable.cs