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
- ThrowHelper.cs
- DbConnectionHelper.cs
- ActivityMarkupSerializationProvider.cs
- HtmlProps.cs
- TextBoxLine.cs
- SettingsContext.cs
- GeometryDrawing.cs
- LeaseManager.cs
- Version.cs
- SafeRightsManagementQueryHandle.cs
- NonClientArea.cs
- Storyboard.cs
- ApplicationActivator.cs
- NameValueFileSectionHandler.cs
- initElementDictionary.cs
- ECDsa.cs
- categoryentry.cs
- DataColumnCollection.cs
- assemblycache.cs
- DataListCommandEventArgs.cs
- MetadataItem.cs
- METAHEADER.cs
- ColumnPropertiesGroup.cs
- SimpleBitVector32.cs
- BamlVersionHeader.cs
- UserInitiatedNavigationPermission.cs
- StringHandle.cs
- EntityContainerEntitySet.cs
- Context.cs
- FigureHelper.cs
- GPRECT.cs
- HttpCacheVaryByContentEncodings.cs
- LocalTransaction.cs
- Configuration.cs
- StsCommunicationException.cs
- NameValueCollection.cs
- DataServicePagingProviderWrapper.cs
- ViewRendering.cs
- StringReader.cs
- MexTcpBindingCollectionElement.cs
- InvalidOleVariantTypeException.cs
- LogicalTreeHelper.cs
- CompareValidator.cs
- ExclusiveHandle.cs
- UserControlBuildProvider.cs
- RegexTree.cs
- XmlQuerySequence.cs
- UnitySerializationHolder.cs
- CommandConverter.cs
- DataServiceEntityAttribute.cs
- PassportPrincipal.cs
- OdbcConnectionHandle.cs
- MarshalDirectiveException.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ScaleTransform3D.cs
- Panel.cs
- ListManagerBindingsCollection.cs
- SQLByteStorage.cs
- FormDocumentDesigner.cs
- MetadataArtifactLoaderResource.cs
- StyleSheet.cs
- MetadataPropertyCollection.cs
- BitmapEffectDrawingContent.cs
- assertwrapper.cs
- InheritanceContextHelper.cs
- Encoder.cs
- _NegoState.cs
- MultiTrigger.cs
- HttpWebResponse.cs
- SortedList.cs
- DataGridViewComboBoxEditingControl.cs
- LayoutUtils.cs
- DnsEndPoint.cs
- PropertyItem.cs
- IdentityHolder.cs
- NamespaceInfo.cs
- ResourcePermissionBaseEntry.cs
- Listbox.cs
- EventLogTraceListener.cs
- NullableDecimalAverageAggregationOperator.cs
- IListConverters.cs
- SqlDataSourceCommandEventArgs.cs
- MatcherBuilder.cs
- ArraySegment.cs
- TryCatchDesigner.xaml.cs
- ListDataBindEventArgs.cs
- MenuItemBindingCollection.cs
- ContainerAction.cs
- DependencyObject.cs
- UnauthorizedAccessException.cs
- ConfigurationStrings.cs
- TypeUsageBuilder.cs
- listitem.cs
- _ConnectStream.cs
- MediaPlayerState.cs
- AutoSizeComboBox.cs
- RightsManagementPermission.cs
- DataGridAutoFormat.cs
- ConsoleCancelEventArgs.cs
- FactoryGenerator.cs