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
- ObjectListCommandsPage.cs
- JavaScriptObjectDeserializer.cs
- ContextStaticAttribute.cs
- NodeFunctions.cs
- HttpDictionary.cs
- FormClosingEvent.cs
- LightweightCodeGenerator.cs
- NotifyIcon.cs
- SafePEFileHandle.cs
- PerformanceCounter.cs
- ThemeDictionaryExtension.cs
- DefaultMemberAttribute.cs
- IconConverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- Variant.cs
- BadImageFormatException.cs
- ElementHostPropertyMap.cs
- UserNamePasswordValidator.cs
- BaseResourcesBuildProvider.cs
- CollectionConverter.cs
- SplitterCancelEvent.cs
- XmlAtomicValue.cs
- DefaultPerformanceCounters.cs
- PreProcessor.cs
- NetworkInterface.cs
- StringHandle.cs
- InkSerializer.cs
- GenerateHelper.cs
- BindingMemberInfo.cs
- ServiceOperationWrapper.cs
- HttpModulesSection.cs
- LogicalTreeHelper.cs
- BrowserDefinitionCollection.cs
- LongPath.cs
- LogLogRecord.cs
- RayMeshGeometry3DHitTestResult.cs
- Atom10FormatterFactory.cs
- ControlCollection.cs
- Panel.cs
- TypeElement.cs
- CubicEase.cs
- WebPartActionVerb.cs
- DataColumnMapping.cs
- Byte.cs
- ExtensionDataReader.cs
- Number.cs
- FontCacheUtil.cs
- WebCategoryAttribute.cs
- PropertyPanel.cs
- EventLogPermissionAttribute.cs
- ApplicationBuildProvider.cs
- HttpListenerRequest.cs
- PropertyOrder.cs
- IdentitySection.cs
- ToolStrip.cs
- SafeWaitHandle.cs
- UIElement.cs
- ToolStripManager.cs
- GridViewSelectEventArgs.cs
- Bits.cs
- InfiniteIntConverter.cs
- TextStore.cs
- AccessibilityHelperForVista.cs
- ValuePatternIdentifiers.cs
- DataGridViewDataConnection.cs
- ToolStripDropDown.cs
- ObservableCollection.cs
- SqlProvider.cs
- ClrPerspective.cs
- Literal.cs
- UInt16Converter.cs
- MSG.cs
- DataGridViewColumnTypePicker.cs
- DataServiceHost.cs
- InputScope.cs
- Operators.cs
- ClearTypeHintValidation.cs
- CommandSet.cs
- ProxyWebPartManager.cs
- TimelineGroup.cs
- IntPtr.cs
- CompiledRegexRunner.cs
- ExecutionContext.cs
- wgx_render.cs
- BulletDecorator.cs
- Win32PrintDialog.cs
- EmbeddedMailObject.cs
- Vector3DKeyFrameCollection.cs
- PenLineCapValidation.cs
- AffineTransform3D.cs
- ExcludePathInfo.cs
- SoapTransportImporter.cs
- XamlSerializerUtil.cs
- TreeNodeCollection.cs
- ProcessStartInfo.cs
- ScriptControlManager.cs
- CheckBoxList.cs
- ExtensibleClassFactory.cs
- DBProviderConfigurationHandler.cs
- DocumentApplicationJournalEntry.cs