Code:
/ DotNET / DotNET / 8.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
- NotFiniteNumberException.cs
- SelectionRangeConverter.cs
- QilGenerator.cs
- Label.cs
- XmlDocumentSerializer.cs
- XmlSerializerNamespaces.cs
- XPathAxisIterator.cs
- WindowsListViewGroupHelper.cs
- SerializationStore.cs
- GenericTextProperties.cs
- DBDataPermission.cs
- HttpStreamXmlDictionaryWriter.cs
- DoubleLink.cs
- __ConsoleStream.cs
- ComponentManagerBroker.cs
- DNS.cs
- CounterSample.cs
- arc.cs
- StreamGeometry.cs
- GregorianCalendar.cs
- TextTreeInsertElementUndoUnit.cs
- XsltSettings.cs
- IDispatchConstantAttribute.cs
- CodeCommentStatementCollection.cs
- VsPropertyGrid.cs
- SqlNodeAnnotation.cs
- ControlParameter.cs
- RadioButtonPopupAdapter.cs
- RelativeSource.cs
- VariantWrapper.cs
- XmlDataDocument.cs
- CharUnicodeInfo.cs
- DefaultHttpHandler.cs
- XmlIncludeAttribute.cs
- ISAPIApplicationHost.cs
- LicenseManager.cs
- ChannelManagerBase.cs
- InlineCollection.cs
- BrushMappingModeValidation.cs
- ResourcePool.cs
- documentation.cs
- Metafile.cs
- DateTimeOffset.cs
- EncryptedPackage.cs
- ServiceOperationParameter.cs
- CheckBoxBaseAdapter.cs
- ToolboxItemFilterAttribute.cs
- WebRequest.cs
- Annotation.cs
- ReadContentAsBinaryHelper.cs
- TemplateBindingExpression.cs
- MetadataSource.cs
- AssociatedControlConverter.cs
- TdsParserStateObject.cs
- IteratorDescriptor.cs
- Triplet.cs
- InheritedPropertyChangedEventArgs.cs
- StylusOverProperty.cs
- FigureParaClient.cs
- SlipBehavior.cs
- DiscoveryClientDocuments.cs
- TypeDependencyAttribute.cs
- WindowsListViewItemStartMenu.cs
- SubclassTypeValidator.cs
- ToggleProviderWrapper.cs
- BinaryObjectInfo.cs
- TouchFrameEventArgs.cs
- RelationshipWrapper.cs
- GraphicsState.cs
- Matrix3DConverter.cs
- MetadataItemCollectionFactory.cs
- ComplexLine.cs
- ToolStripArrowRenderEventArgs.cs
- KnownTypes.cs
- Socket.cs
- DataGridViewCellFormattingEventArgs.cs
- EntityKeyElement.cs
- DataGridViewColumnHeaderCell.cs
- ScrollChrome.cs
- LostFocusEventManager.cs
- DurableInstanceManager.cs
- WebColorConverter.cs
- ObjectListShowCommandsEventArgs.cs
- CharUnicodeInfo.cs
- XmlCharCheckingReader.cs
- CollectionsUtil.cs
- SecurityElement.cs
- URLIdentityPermission.cs
- DbProviderFactories.cs
- DataGridRowClipboardEventArgs.cs
- DesignerPerfEventProvider.cs
- PropertyGeneratedEventArgs.cs
- ToolStripLabel.cs
- FileResponseElement.cs
- DeclaredTypeValidatorAttribute.cs
- SocketCache.cs
- Internal.cs
- Inflater.cs
- ObjectHandle.cs
- CodeTypeDeclaration.cs