Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CommonUI / System / Drawing / Advanced / FontCollection.cs / 1 / 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; ////// /// 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. //------------------------------------------------------------------------------ ///// Allows an object to free resources before the object is /// reclaimed by the Garbage Collector ( ///). /// // 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; ////// /// 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./// 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
- LazyTextWriterCreator.cs
- StylusPointPropertyInfo.cs
- BaseValidator.cs
- HttpConfigurationContext.cs
- SecurityState.cs
- AncestorChangedEventArgs.cs
- CollectionEditorDialog.cs
- PerspectiveCamera.cs
- MissingSatelliteAssemblyException.cs
- OSFeature.cs
- TypeConverterHelper.cs
- NotifyParentPropertyAttribute.cs
- CommandPlan.cs
- COM2PropertyPageUITypeConverter.cs
- RangeContentEnumerator.cs
- HttpFileCollection.cs
- safePerfProviderHandle.cs
- NavigationProperty.cs
- ExpressionHelper.cs
- FigureParagraph.cs
- IisTraceListener.cs
- SymDocumentType.cs
- Underline.cs
- ArcSegment.cs
- ServerType.cs
- ItemCollection.cs
- Application.cs
- InvariantComparer.cs
- DuplicateMessageDetector.cs
- GradientSpreadMethodValidation.cs
- Section.cs
- NullableBoolConverter.cs
- Event.cs
- SerializationSectionGroup.cs
- TimeSpanParse.cs
- DashStyle.cs
- XmlSerializerImportOptions.cs
- SignedPkcs7.cs
- SqlDataSourceView.cs
- DateTimeValueSerializerContext.cs
- SettingsProperty.cs
- Line.cs
- ShaderRenderModeValidation.cs
- MetadataProperty.cs
- UriScheme.cs
- SchemaNotation.cs
- MultilineStringConverter.cs
- BuildManager.cs
- NegotiateStream.cs
- ImmutablePropertyDescriptorGridEntry.cs
- PackageRelationshipCollection.cs
- MSG.cs
- CheckBoxStandardAdapter.cs
- PageRequestManager.cs
- QualificationDataItem.cs
- InternalConfigSettingsFactory.cs
- JsonXmlDataContract.cs
- StreamReader.cs
- ResourceReader.cs
- HtmlElementEventArgs.cs
- StringBlob.cs
- PageResolution.cs
- RadioButtonBaseAdapter.cs
- Version.cs
- AccessedThroughPropertyAttribute.cs
- PropertyChangeTracker.cs
- ObjectToModelValueConverter.cs
- BindingContext.cs
- SdlChannelSink.cs
- ExtensionQuery.cs
- DataGridViewCellLinkedList.cs
- FacetValues.cs
- ComponentCommands.cs
- BrowserCapabilitiesFactory.cs
- NetworkInformationPermission.cs
- CodeMemberEvent.cs
- TextDecorations.cs
- SurrogateDataContract.cs
- BinaryMethodMessage.cs
- StackOverflowException.cs
- FormatConvertedBitmap.cs
- KeyedCollection.cs
- ScriptResourceInfo.cs
- SingleAnimationUsingKeyFrames.cs
- DataGridSortCommandEventArgs.cs
- MetadataResolver.cs
- DaylightTime.cs
- RawAppCommandInputReport.cs
- BitmapCache.cs
- FreezableDefaultValueFactory.cs
- XmlNode.cs
- OneOf.cs
- LayoutEngine.cs
- GuidTagList.cs
- SystemMulticastIPAddressInformation.cs
- TableCell.cs
- DebugView.cs
- XmlSchemaObject.cs
- Rules.cs
- ElementUtil.cs