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
- HwndMouseInputProvider.cs
- ViewStateException.cs
- AssignDesigner.xaml.cs
- SqlFileStream.cs
- GacUtil.cs
- CodeThrowExceptionStatement.cs
- StateMachineWorkflowDesigner.cs
- InlineUIContainer.cs
- LocationSectionRecord.cs
- DataSourceHelper.cs
- UpdateExpressionVisitor.cs
- DataGridCellItemAutomationPeer.cs
- StringAnimationUsingKeyFrames.cs
- EdmItemCollection.cs
- _HeaderInfoTable.cs
- SlipBehavior.cs
- MSHTMLHostUtil.cs
- Visual3DCollection.cs
- StrokeNodeOperations2.cs
- ToolStripGripRenderEventArgs.cs
- PolicyReader.cs
- ActivityExecutionFilter.cs
- TableAdapterManagerMethodGenerator.cs
- WCFBuildProvider.cs
- ApplicationException.cs
- categoryentry.cs
- TransformerConfigurationWizardBase.cs
- TimeIntervalCollection.cs
- JournalEntryListConverter.cs
- SignatureDescription.cs
- AssociationType.cs
- SrgsText.cs
- ByeMessageApril2005.cs
- ExpressionWriter.cs
- DbProviderServices.cs
- Util.cs
- SQLBinary.cs
- MenuItemStyleCollection.cs
- BlurBitmapEffect.cs
- MultilineStringConverter.cs
- HttpListenerPrefixCollection.cs
- SelectionHighlightInfo.cs
- IntersectQueryOperator.cs
- SpecialNameAttribute.cs
- MimeTextImporter.cs
- DynamicUpdateCommand.cs
- QuadraticBezierSegment.cs
- CompositeControl.cs
- DataGridViewRowEventArgs.cs
- HideDisabledControlAdapter.cs
- FlowLayoutSettings.cs
- ListViewPagedDataSource.cs
- DataTableExtensions.cs
- MiniCustomAttributeInfo.cs
- UriSchemeKeyedCollection.cs
- Peer.cs
- Literal.cs
- webeventbuffer.cs
- DrawingGroup.cs
- MailMessage.cs
- TransformerConfigurationWizardBase.cs
- StringBuilder.cs
- ContextBase.cs
- FontUnitConverter.cs
- cache.cs
- ListViewItemEventArgs.cs
- LinkConverter.cs
- UserControlParser.cs
- SmiEventSink_DeferedProcessing.cs
- SymbolTable.cs
- DataViewSettingCollection.cs
- TypeSystemProvider.cs
- XmlSchemaInferenceException.cs
- TTSEngineProxy.cs
- ObjectDataSourceDisposingEventArgs.cs
- XmlLanguageConverter.cs
- ParentControlDesigner.cs
- MiniMapControl.xaml.cs
- OdbcConnection.cs
- AuthenticationModulesSection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- DescendentsWalkerBase.cs
- DescendantOverDescendantQuery.cs
- ResourceCategoryAttribute.cs
- EntityContainerAssociationSet.cs
- SiteMap.cs
- PenContexts.cs
- _IPv4Address.cs
- XmlIlTypeHelper.cs
- WindowsRichEdit.cs
- SourceCollection.cs
- ConfigurationValues.cs
- FormDesigner.cs
- COMException.cs
- ServiceAuthorizationBehavior.cs
- MetadataArtifactLoader.cs
- TextElementEditingBehaviorAttribute.cs
- StyleBamlTreeBuilder.cs
- MissingSatelliteAssemblyException.cs
- RegionIterator.cs