Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / Advanced / FontCollection.cs / 1 / FontCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /*************************************************************************\ * * Copyright (c) 1998-1999, Microsoft Corp. All Rights Reserved. * * Module Name: * * font.cs * * Abstract: * * COM+ wrapper for GDI+ font objects * * Revision History: * * 3/16/2000 [...] * Created it. * \**************************************************************************/ namespace System.Drawing.Text { using System.Diagnostics; using System; using System.Drawing; using System.Drawing.Internal; using System.Runtime.InteropServices; using System.ComponentModel; using Microsoft.Win32; ////// /// When inherited, enumerates the FontFamily /// objects in a collection of fonts. /// public abstract class FontCollection : IDisposable { internal IntPtr nativeFontCollection; internal FontCollection() { nativeFontCollection = IntPtr.Zero; } ////// /// Disposes of this public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ////// protected virtual void Dispose(bool disposing) { // nothing... } /// /// /// public FontFamily[] Families { get { int numSought = 0; int status = SafeNativeMethods.Gdip.GdipGetFontCollectionFamilyCount(new HandleRef(this, nativeFontCollection), out numSought); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); IntPtr[] gpfamilies = new IntPtr[numSought]; int numFound = 0; status = SafeNativeMethods.Gdip.GdipGetFontCollectionFamilyList(new HandleRef(this, nativeFontCollection), numSought, gpfamilies, out numFound); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); Debug.Assert(numSought == numFound, "GDI+ can't give a straight answer about how many fonts there are"); FontFamily[] families = new FontFamily[numFound]; for (int f = 0; f < numFound; f++) { IntPtr native; SafeNativeMethods.Gdip.GdipCloneFontFamily(new HandleRef(null, (IntPtr)gpfamilies[f]), out native); families[f] = new FontFamily(native); } return families; } } /** * Object cleanup */ ////// Gets the array of ////// objects associated with this . /// /// /// ~FontCollection() { Dispose(false); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// Allows an object to free resources before the object is /// reclaimed by the Garbage Collector ( ///). ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- COM2IManagedPerPropertyBrowsingHandler.cs
- XmlObjectSerializerReadContext.cs
- CodeTypeDelegate.cs
- ConfigXmlSignificantWhitespace.cs
- RoleServiceManager.cs
- SymLanguageVendor.cs
- TimeSpan.cs
- MobileSysDescriptionAttribute.cs
- _SecureChannel.cs
- DbConnectionInternal.cs
- KeyProperty.cs
- CalculatedColumn.cs
- IdentityReference.cs
- Vector3dCollection.cs
- CodeArgumentReferenceExpression.cs
- EditorReuseAttribute.cs
- ConfigurationLocation.cs
- KoreanLunisolarCalendar.cs
- BufferedWebEventProvider.cs
- WinEventQueueItem.cs
- ContextStaticAttribute.cs
- CodeVariableDeclarationStatement.cs
- HostedElements.cs
- PasswordValidationException.cs
- X509UI.cs
- TakeQueryOptionExpression.cs
- ParameterCollection.cs
- NamespaceExpr.cs
- TextElementEnumerator.cs
- ComponentEvent.cs
- StringExpressionSet.cs
- CodeParameterDeclarationExpression.cs
- UnsafeNativeMethods.cs
- GridView.cs
- Grant.cs
- CompressedStack.cs
- StorageComplexTypeMapping.cs
- StreamGeometryContext.cs
- RenderData.cs
- HwndSubclass.cs
- JsonSerializer.cs
- XmlAttributeAttribute.cs
- Oid.cs
- XPathSelfQuery.cs
- RemoveStoryboard.cs
- DateTimeConstantAttribute.cs
- SystemUdpStatistics.cs
- PropertySourceInfo.cs
- ProgressPage.cs
- DbXmlEnabledProviderManifest.cs
- BinaryMessageEncoder.cs
- adornercollection.cs
- SetterTriggerConditionValueConverter.cs
- PopOutPanel.cs
- URLAttribute.cs
- DoubleAnimationUsingKeyFrames.cs
- MetadataPropertyAttribute.cs
- CountdownEvent.cs
- ExpressionConverter.cs
- IssuerInformation.cs
- EventProviderWriter.cs
- HtmlTableRowCollection.cs
- UserControlDocumentDesigner.cs
- InfoCardRSACryptoProvider.cs
- VectorAnimationBase.cs
- SqlServer2KCompatibilityAnnotation.cs
- ExtenderControl.cs
- Int16.cs
- SqlBulkCopyColumnMappingCollection.cs
- ZoneLinkButton.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- DirtyTextRange.cs
- SecurityMessageProperty.cs
- ResourceAttributes.cs
- Visitors.cs
- FilteredAttributeCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- ReadOnlyCollectionBase.cs
- NodeFunctions.cs
- DelegateBodyWriter.cs
- ChildDocumentBlock.cs
- EnumMemberAttribute.cs
- NetworkCredential.cs
- DirtyTextRange.cs
- Rules.cs
- TablePattern.cs
- ProxyOperationRuntime.cs
- AsyncWaitHandle.cs
- ToolStripDropDown.cs
- Keyboard.cs
- RemotingAttributes.cs
- Header.cs
- SecuritySessionSecurityTokenProvider.cs
- FocusManager.cs
- HandlerFactoryWrapper.cs
- TextLineResult.cs
- contentDescriptor.cs
- PropertyItem.cs
- HtmlInputImage.cs
- UpdateTranslator.cs