Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / PropertyItemInternal.cs / 1305376 / 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
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PathFigure.cs
- Select.cs
- SmtpDateTime.cs
- DropShadowEffect.cs
- EntityDataSourceState.cs
- RadialGradientBrush.cs
- UInt64Converter.cs
- GridView.cs
- GrammarBuilderBase.cs
- TextSegment.cs
- CacheOutputQuery.cs
- GenericRootAutomationPeer.cs
- PreservationFileReader.cs
- DependencySource.cs
- FormsAuthenticationModule.cs
- Relationship.cs
- PageCache.cs
- DefaultWorkflowTransactionService.cs
- SystemIcmpV6Statistics.cs
- SByte.cs
- CodeTypeConstructor.cs
- ProcessProtocolHandler.cs
- DataGridViewSelectedColumnCollection.cs
- DesignerActionPanel.cs
- XslCompiledTransform.cs
- PropertyItemInternal.cs
- OdbcEnvironmentHandle.cs
- CodeAttributeDeclarationCollection.cs
- BaseCAMarshaler.cs
- DataGridViewLayoutData.cs
- FactoryRecord.cs
- Queue.cs
- IChannel.cs
- ProviderConnectionPointCollection.cs
- _RequestCacheProtocol.cs
- ExpressionVisitor.cs
- PolicyManager.cs
- ToolStrip.cs
- PerformanceCountersElement.cs
- PolyLineSegmentFigureLogic.cs
- HtmlControlPersistable.cs
- DocumentReference.cs
- TypeLibConverter.cs
- XmlUTF8TextReader.cs
- ContextStaticAttribute.cs
- ReflectionUtil.cs
- EditorZoneDesigner.cs
- SafeHandle.cs
- InternalReceiveMessage.cs
- SkipQueryOptionExpression.cs
- SafeEventLogWriteHandle.cs
- CodeIdentifier.cs
- CodeGenerator.cs
- ExpressionBinding.cs
- DesignTimeVisibleAttribute.cs
- SEHException.cs
- processwaithandle.cs
- MimeTypeAttribute.cs
- XmlSchemaProviderAttribute.cs
- URLIdentityPermission.cs
- SafeFileMapViewHandle.cs
- SimpleApplicationHost.cs
- HostedHttpTransportManager.cs
- ObjectDataSourceSelectingEventArgs.cs
- DiscoveryReferences.cs
- AppDomainUnloadedException.cs
- EventLogPermissionEntry.cs
- MenuAdapter.cs
- Light.cs
- AutomationPropertyInfo.cs
- EmptyEnumerator.cs
- SiteMembershipCondition.cs
- UpdateProgress.cs
- TypeToken.cs
- SoapProtocolImporter.cs
- Parser.cs
- ColorMatrix.cs
- OracleFactory.cs
- DynamicMethod.cs
- GenerateTemporaryTargetAssembly.cs
- BindingObserver.cs
- SettingsSavedEventArgs.cs
- SaveFileDialog.cs
- XmlSchemaChoice.cs
- Substitution.cs
- PlacementWorkspace.cs
- CertificateManager.cs
- ToolStripManager.cs
- ToolStripContextMenu.cs
- NullableIntMinMaxAggregationOperator.cs
- LinqDataSourceValidationException.cs
- CommonDialog.cs
- DataGridItemEventArgs.cs
- StandardOleMarshalObject.cs
- BooleanFunctions.cs
- VerificationAttribute.cs
- RegexWorker.cs
- SqlTriggerAttribute.cs
- CompoundFileDeflateTransform.cs
- WebPartConnectionsCloseVerb.cs