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
- CollectionBuilder.cs
- Console.cs
- IndentedWriter.cs
- WebPartConnectionsEventArgs.cs
- DataSourceCache.cs
- RegexCharClass.cs
- BuildProvider.cs
- DbMetaDataCollectionNames.cs
- MulticastDelegate.cs
- ProviderCommandInfoUtils.cs
- InputReport.cs
- StylusShape.cs
- RegistryKey.cs
- VarInfo.cs
- Content.cs
- keycontainerpermission.cs
- BrowserCapabilitiesFactoryBase.cs
- Canvas.cs
- IItemContainerGenerator.cs
- TextRenderer.cs
- CompositeDispatchFormatter.cs
- EpmContentSerializerBase.cs
- SeekStoryboard.cs
- DesignerTextWriter.cs
- CodeTypeReference.cs
- AudioFormatConverter.cs
- OLEDB_Enum.cs
- BitmapEffectState.cs
- DrawingImage.cs
- SoapCodeExporter.cs
- PropertyEntry.cs
- ContainerVisual.cs
- SQLStringStorage.cs
- LoadRetryConstantStrategy.cs
- RuntimeConfigLKG.cs
- XappLauncher.cs
- HttpServerVarsCollection.cs
- RemoteWebConfigurationHost.cs
- FigureParagraph.cs
- AVElementHelper.cs
- BitmapSourceSafeMILHandle.cs
- ProfileGroupSettingsCollection.cs
- UpdateTracker.cs
- MsmqIntegrationProcessProtocolHandler.cs
- CollectionDataContractAttribute.cs
- PrimitiveCodeDomSerializer.cs
- GregorianCalendar.cs
- ReferentialConstraint.cs
- EntityCommandExecutionException.cs
- BindableAttribute.cs
- NumberAction.cs
- AspProxy.cs
- OdbcPermission.cs
- Point3DAnimation.cs
- DashStyles.cs
- SQLInt32Storage.cs
- XmlSchemaException.cs
- QueuedDeliveryRequirementsMode.cs
- ProcessRequestArgs.cs
- PerformanceCounter.cs
- CacheHelper.cs
- ReadOnlyCollectionBuilder.cs
- XmlSchemaAnnotation.cs
- SessionStateUtil.cs
- ProgressBar.cs
- ProviderConnectionPoint.cs
- DockPattern.cs
- SponsorHelper.cs
- SQLBytes.cs
- AssemblyUtil.cs
- ConnectionStringSettingsCollection.cs
- WebPartConnectionCollection.cs
- SignedXml.cs
- DataGridRow.cs
- NameObjectCollectionBase.cs
- NetworkInformationException.cs
- Encoder.cs
- ListViewItem.cs
- MetadataUtil.cs
- ValidationErrorEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- SizeAnimation.cs
- CodePrimitiveExpression.cs
- DataTableMapping.cs
- RegexParser.cs
- WindowsListViewGroupHelper.cs
- ThrowHelper.cs
- InvokeGenerator.cs
- DataGridViewIntLinkedList.cs
- ListenerSingletonConnectionReader.cs
- GetPageNumberCompletedEventArgs.cs
- smtppermission.cs
- OpenTypeCommon.cs
- GraphicsContainer.cs
- ClientTargetSection.cs
- RuleProcessor.cs
- PlanCompiler.cs
- EqualityComparer.cs
- CodeTypeReferenceSerializer.cs
- ExtenderControl.cs