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
- BitmapEffect.cs
- PointLightBase.cs
- SimpleBitVector32.cs
- HttpCapabilitiesEvaluator.cs
- RemotingServices.cs
- ResolvePPIDRequest.cs
- AssemblyCacheEntry.cs
- ActivityBindForm.Designer.cs
- OpenFileDialog.cs
- QilSortKey.cs
- SemaphoreSecurity.cs
- CookieHandler.cs
- GridView.cs
- SoapExtension.cs
- AnnotationComponentManager.cs
- HttpAsyncResult.cs
- StorageAssociationTypeMapping.cs
- SpeakCompletedEventArgs.cs
- PrintController.cs
- ChannelFactoryBase.cs
- LiteralText.cs
- SolidColorBrush.cs
- MergePropertyDescriptor.cs
- followingsibling.cs
- DateTimeUtil.cs
- PropertyPathWorker.cs
- AdornerPresentationContext.cs
- TextTreePropertyUndoUnit.cs
- UpdatableGenericsFeature.cs
- ModuleBuilderData.cs
- ActivityDesignerResources.cs
- SerializerDescriptor.cs
- DiagnosticTraceSource.cs
- BasicCellRelation.cs
- XmlDataLoader.cs
- DiscoveryDocumentSearchPattern.cs
- DateTime.cs
- KeyManager.cs
- SafeEventLogWriteHandle.cs
- LinqDataSourceEditData.cs
- ProfileModule.cs
- BamlLocalizer.cs
- HttpRequest.cs
- PartialArray.cs
- NavigationPropertyEmitter.cs
- _ShellExpression.cs
- MemberJoinTreeNode.cs
- ColorBuilder.cs
- Evidence.cs
- TraceLog.cs
- CommandPlan.cs
- SHA1Managed.cs
- WorkflowTerminatedException.cs
- XLinq.cs
- GetBrowserTokenRequest.cs
- WebPartEditVerb.cs
- FilteredReadOnlyMetadataCollection.cs
- RichTextBoxConstants.cs
- DPCustomTypeDescriptor.cs
- ThreadPool.cs
- ObjectNavigationPropertyMapping.cs
- MouseDevice.cs
- FrameworkTemplate.cs
- XmlEventCache.cs
- MemberPath.cs
- WebPartDisplayMode.cs
- PeerObject.cs
- EffectiveValueEntry.cs
- SingleStorage.cs
- FileVersionInfo.cs
- securestring.cs
- AdjustableArrowCap.cs
- GridItemCollection.cs
- BaseParser.cs
- BaseTreeIterator.cs
- COAUTHINFO.cs
- FormsAuthenticationCredentials.cs
- CodeAttachEventStatement.cs
- OrderedDictionary.cs
- SafeCertificateContext.cs
- ModelFactory.cs
- WinInet.cs
- DataGridViewCellStateChangedEventArgs.cs
- TextElement.cs
- ExtendedProperty.cs
- SecurityUtils.cs
- SecUtil.cs
- CollectionViewProxy.cs
- EngineSiteSapi.cs
- WindowsSolidBrush.cs
- FileInfo.cs
- GroupBoxDesigner.cs
- Helpers.cs
- EdmFunction.cs
- cookieexception.cs
- WebPartManager.cs
- IndexingContentUnit.cs
- QueryResponse.cs
- UnsafeNativeMethods.cs
- SizeAnimationUsingKeyFrames.cs