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
- _emptywebproxy.cs
- TempFiles.cs
- ContentValidator.cs
- TrailingSpaceComparer.cs
- SharedPersonalizationStateInfo.cs
- PerformanceCounterPermissionEntry.cs
- URLString.cs
- RightsManagementEncryptedStream.cs
- SpanIndex.cs
- EntityClientCacheEntry.cs
- Int64Converter.cs
- SystemWebExtensionsSectionGroup.cs
- HwndProxyElementProvider.cs
- DataQuery.cs
- TableParagraph.cs
- XmlNavigatorFilter.cs
- DateTimeFormatInfoScanner.cs
- MetadataFile.cs
- QualifiedId.cs
- Clipboard.cs
- SecurityTokenReferenceStyle.cs
- ADRoleFactoryConfiguration.cs
- GPRECT.cs
- DataConnectionHelper.cs
- SettingsAttributeDictionary.cs
- PrimarySelectionGlyph.cs
- StylusCollection.cs
- EventBuilder.cs
- CreateInstanceBinder.cs
- Material.cs
- CorrelationValidator.cs
- ThousandthOfEmRealDoubles.cs
- MessageBox.cs
- IntSecurity.cs
- ComboBoxRenderer.cs
- WebPartUtil.cs
- PlatformCulture.cs
- XmlObjectSerializerReadContextComplexJson.cs
- StateValidator.cs
- DirectoryLocalQuery.cs
- DataGridViewRowCancelEventArgs.cs
- NativeMethods.cs
- SiteMapDataSourceView.cs
- EntityModelSchemaGenerator.cs
- TemplateBindingExtensionConverter.cs
- Size3DConverter.cs
- RemotingConfiguration.cs
- CommandLibraryHelper.cs
- VersionedStream.cs
- ProvidePropertyAttribute.cs
- KnownIds.cs
- RC2.cs
- HtmlTableCellCollection.cs
- sqlpipe.cs
- CapabilitiesState.cs
- SeekStoryboard.cs
- log.cs
- MenuAdapter.cs
- RepeatInfo.cs
- LinqDataSourceHelper.cs
- PieceDirectory.cs
- WebPartDescription.cs
- HttpResponseHeader.cs
- CopyNamespacesAction.cs
- EdmItemCollection.cs
- OuterGlowBitmapEffect.cs
- VirtualPathProvider.cs
- ListControl.cs
- OleDbDataAdapter.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- TextUtf8RawTextWriter.cs
- OleDbError.cs
- CheckBoxFlatAdapter.cs
- IsolationInterop.cs
- TextParaClient.cs
- InputProviderSite.cs
- BitmapCodecInfoInternal.cs
- MonthCalendar.cs
- PresentationAppDomainManager.cs
- SourceChangedEventArgs.cs
- AnimationLayer.cs
- Literal.cs
- SqlCommandBuilder.cs
- PlaceHolder.cs
- Base64Encoder.cs
- WebAdminConfigurationHelper.cs
- TerminatorSinks.cs
- RTTypeWrapper.cs
- DataPagerFieldCommandEventArgs.cs
- KnownTypes.cs
- MimeParameters.cs
- RIPEMD160Managed.cs
- ColorTranslator.cs
- PreProcessInputEventArgs.cs
- CodeTypeDelegate.cs
- ToolStripDropDownClosedEventArgs.cs
- HtmlTableCellCollection.cs
- DocumentOrderQuery.cs
- BadImageFormatException.cs
- DiscriminatorMap.cs