Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Advanced / FontCollection.cs / 1305376 / FontCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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; using System.Runtime.Versioning; ////// /// 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 { [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Process)] 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./// 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
- DashStyle.cs
- _WinHttpWebProxyDataBuilder.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- IFlowDocumentViewer.cs
- ComponentEditorForm.cs
- XMLSchema.cs
- IisTraceListener.cs
- BaseTemplateParser.cs
- MenuScrollingVisibilityConverter.cs
- _NegoState.cs
- DesignerCategoryAttribute.cs
- MsmqIntegrationBindingElement.cs
- SurrogateChar.cs
- IgnoreFileBuildProvider.cs
- FunctionDetailsReader.cs
- SafeViewOfFileHandle.cs
- OleDbPermission.cs
- OleTxTransaction.cs
- ClockController.cs
- QueryStringParameter.cs
- SvcMapFileLoader.cs
- ProcessHostFactoryHelper.cs
- XmlCharacterData.cs
- DataGridTablesFactory.cs
- Viewport3DAutomationPeer.cs
- ArrayConverter.cs
- Drawing.cs
- WebServiceErrorEvent.cs
- DataSourceCacheDurationConverter.cs
- TextServicesCompartmentEventSink.cs
- XNameConverter.cs
- __ComObject.cs
- BindUriHelper.cs
- PropertyPath.cs
- Timeline.cs
- PenThread.cs
- querybuilder.cs
- IconConverter.cs
- HttpCapabilitiesBase.cs
- DataListAutoFormat.cs
- WebConfigurationHost.cs
- CriticalHandle.cs
- Ticks.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- AlphabeticalEnumConverter.cs
- VarInfo.cs
- ArgIterator.cs
- PagesSection.cs
- TextTreeNode.cs
- XmlDataImplementation.cs
- ListViewItemSelectionChangedEvent.cs
- BamlLocalizableResource.cs
- DataContractSerializer.cs
- DropShadowEffect.cs
- XPathDocument.cs
- IteratorDescriptor.cs
- FilterQuery.cs
- FixedSOMTable.cs
- Repeater.cs
- SingleAnimationBase.cs
- ActiveXSite.cs
- TargetParameterCountException.cs
- EventNotify.cs
- CertificateElement.cs
- ClientConfigPaths.cs
- XPathNodeList.cs
- PersonalizableTypeEntry.cs
- MenuAutomationPeer.cs
- ColumnCollection.cs
- messageonlyhwndwrapper.cs
- FontWeights.cs
- AddressHeaderCollectionElement.cs
- _CommandStream.cs
- TypeForwardedToAttribute.cs
- MulticastOption.cs
- ObjectItemCollection.cs
- NavigateEvent.cs
- ValidatorCompatibilityHelper.cs
- PartialTrustVisibleAssembly.cs
- XmlSchemaAny.cs
- Win32SafeHandles.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ConstructorArgumentAttribute.cs
- DataListCommandEventArgs.cs
- ReadingWritingEntityEventArgs.cs
- AdornerPresentationContext.cs
- KoreanLunisolarCalendar.cs
- WbemException.cs
- EncoderBestFitFallback.cs
- TextEditorContextMenu.cs
- HtmlEncodedRawTextWriter.cs
- MethodToken.cs
- MenuCommand.cs
- MultiAsyncResult.cs
- InteropEnvironment.cs
- KeyedCollection.cs
- IIS7UserPrincipal.cs
- WebPartCatalogAddVerb.cs
- dsa.cs
- TextRunTypographyProperties.cs