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
- SimpleBitVector32.cs
- HttpsChannelListener.cs
- DataGridViewColumnCollection.cs
- HoistedLocals.cs
- PolicyFactory.cs
- WindowCollection.cs
- _CommandStream.cs
- AspCompat.cs
- VisualStyleElement.cs
- WebBrowserHelper.cs
- DataGridViewComboBoxCell.cs
- ControlParameter.cs
- DuplexSecurityProtocolFactory.cs
- Splitter.cs
- Completion.cs
- SByte.cs
- Queue.cs
- OrthographicCamera.cs
- ServiceHost.cs
- StrongNameMembershipCondition.cs
- DataGridHelper.cs
- XsdBuilder.cs
- ConstNode.cs
- StdRegProviderWrapper.cs
- NotifyCollectionChangedEventArgs.cs
- DependsOnAttribute.cs
- FamilyTypeface.cs
- XMLDiffLoader.cs
- SrgsElementFactoryCompiler.cs
- HttpSessionStateBase.cs
- SecurityHeader.cs
- RequestBringIntoViewEventArgs.cs
- DataGridViewComboBoxCell.cs
- PageMediaSize.cs
- RichTextBox.cs
- CorrelationService.cs
- DataGridToolTip.cs
- MsmqHostedTransportManager.cs
- AndCondition.cs
- SqlConnectionHelper.cs
- DockAndAnchorLayout.cs
- SoapParser.cs
- Avt.cs
- CellParaClient.cs
- OracleConnectionString.cs
- CodeActivityContext.cs
- DataRecordInternal.cs
- NativeCppClassAttribute.cs
- CmsInterop.cs
- SmtpSection.cs
- GeneralTransform3D.cs
- StateBag.cs
- MappingMetadataHelper.cs
- Scalars.cs
- RenameRuleObjectDialog.cs
- DataFormat.cs
- TemplateBindingExtensionConverter.cs
- ContentControl.cs
- linebase.cs
- BitmapMetadataBlob.cs
- QueryFunctions.cs
- HelpProvider.cs
- DrawingGroup.cs
- AutomationPropertyInfo.cs
- OpenTypeMethods.cs
- Util.cs
- FrameworkContextData.cs
- StylusSystemGestureEventArgs.cs
- JsonReaderDelegator.cs
- ExpressionBuilder.cs
- QilTypeChecker.cs
- JapaneseLunisolarCalendar.cs
- SqlDataSourceView.cs
- ThousandthOfEmRealPoints.cs
- ZipIOLocalFileHeader.cs
- CatalogZoneBase.cs
- LoginCancelEventArgs.cs
- DataListGeneralPage.cs
- IndentedTextWriter.cs
- BinaryReader.cs
- RemotingHelper.cs
- PeekCompletedEventArgs.cs
- DoubleCollectionValueSerializer.cs
- ContractMethodInfo.cs
- UserControlDesigner.cs
- SqlFacetAttribute.cs
- FormsAuthenticationUserCollection.cs
- TemplateNameScope.cs
- DbMetaDataCollectionNames.cs
- OdbcHandle.cs
- SettingsAttributes.cs
- ACE.cs
- OutputCacheSection.cs
- XamlFrame.cs
- ValidatorCompatibilityHelper.cs
- PerformanceCountersElement.cs
- TaskHelper.cs
- DataSourceSelectArguments.cs
- UpdatePanelTriggerCollection.cs
- SQLDoubleStorage.cs