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
- ResourceExpressionBuilder.cs
- LinqDataSourceDeleteEventArgs.cs
- GroupedContextMenuStrip.cs
- InfoCardClaim.cs
- ReliableSessionBindingElementImporter.cs
- XmlParser.cs
- MetaModel.cs
- WindowsListViewGroupHelper.cs
- InfoCardKeyedHashAlgorithm.cs
- FilterUserControlBase.cs
- GridViewUpdatedEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- FixedSOMContainer.cs
- EntityUtil.cs
- SchemaElementDecl.cs
- QuaternionKeyFrameCollection.cs
- ReadOnlyHierarchicalDataSource.cs
- SpStreamWrapper.cs
- QuaternionRotation3D.cs
- InternalBufferOverflowException.cs
- GatewayIPAddressInformationCollection.cs
- SparseMemoryStream.cs
- RegistryConfigurationProvider.cs
- UniqueIdentifierService.cs
- CellPartitioner.cs
- SqlDataSourceCommandEventArgs.cs
- SqlDataSourceView.cs
- DashStyle.cs
- PointConverter.cs
- SimpleFieldTemplateUserControl.cs
- ComponentSerializationService.cs
- clipboard.cs
- CodeEntryPointMethod.cs
- ConfigXmlCDataSection.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- BaseParaClient.cs
- XmlMembersMapping.cs
- TreeSet.cs
- VirtualizingStackPanel.cs
- ConnectionInterfaceCollection.cs
- DataGridSortCommandEventArgs.cs
- AssemblyCache.cs
- StrokeCollection.cs
- TextEffectCollection.cs
- ProjectionRewriter.cs
- ComplexBindingPropertiesAttribute.cs
- HtmlInputCheckBox.cs
- ConfigXmlReader.cs
- LockRenewalTask.cs
- DecoderBestFitFallback.cs
- CacheDependency.cs
- IfJoinedCondition.cs
- OracleDateTime.cs
- arabicshape.cs
- TreeNodeClickEventArgs.cs
- TextDecorationCollectionConverter.cs
- HttpListenerContext.cs
- AuthenticatingEventArgs.cs
- ResourceContainer.cs
- IteratorFilter.cs
- WeakEventTable.cs
- SelectionBorderGlyph.cs
- CheckPair.cs
- SoundPlayer.cs
- GifBitmapDecoder.cs
- StringAnimationBase.cs
- ObjectDataSourceMethodEventArgs.cs
- DesigntimeLicenseContext.cs
- HealthMonitoringSection.cs
- ScriptReference.cs
- Mutex.cs
- SafeRegistryHandle.cs
- Compiler.cs
- input.cs
- ItemCheckEvent.cs
- ComPlusServiceHost.cs
- NativeObjectSecurity.cs
- AdornerHitTestResult.cs
- WebPartUtil.cs
- ValidationSummary.cs
- ScaleTransform3D.cs
- StringToken.cs
- ScriptResourceAttribute.cs
- ObjectQueryState.cs
- SetStoryboardSpeedRatio.cs
- MDIControlStrip.cs
- SpanIndex.cs
- ProfileParameter.cs
- ServicePoint.cs
- XmlLinkedNode.cs
- SqlUtils.cs
- MetabaseServerConfig.cs
- LayoutInformation.cs
- EntitySetRetriever.cs
- BmpBitmapDecoder.cs
- WorkflowInstanceExtensionCollection.cs
- FtpRequestCacheValidator.cs
- RepeaterCommandEventArgs.cs
- ControlValuePropertyAttribute.cs
- VoiceSynthesis.cs