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
- GeneralTransformCollection.cs
- ChannelDispatcherBase.cs
- EventLogException.cs
- PropertyManager.cs
- AppearanceEditorPart.cs
- WinCategoryAttribute.cs
- StrongNameKeyPair.cs
- nulltextnavigator.cs
- WCFModelStrings.Designer.cs
- ContentElement.cs
- SqlDataSourceConfigureFilterForm.cs
- Switch.cs
- Vector3D.cs
- SimpleRecyclingCache.cs
- MissingSatelliteAssemblyException.cs
- ThreadStartException.cs
- SortableBindingList.cs
- EmbeddedMailObject.cs
- DataSourceControl.cs
- ADMembershipProvider.cs
- ToolboxComponentsCreatingEventArgs.cs
- StrongNameUtility.cs
- Rotation3DKeyFrameCollection.cs
- EDesignUtil.cs
- FormViewPagerRow.cs
- AxHost.cs
- __Filters.cs
- ScriptRegistrationManager.cs
- InvalidateEvent.cs
- Matrix.cs
- ExpandableObjectConverter.cs
- RemotingException.cs
- TraceSection.cs
- Update.cs
- exports.cs
- BindingList.cs
- WebSysDisplayNameAttribute.cs
- ViewSimplifier.cs
- HtmlShimManager.cs
- Separator.cs
- DataGridViewCellCollection.cs
- ClrPerspective.cs
- StringTraceRecord.cs
- ListBox.cs
- TextParagraph.cs
- EntityDataSourceDataSelection.cs
- MgmtResManager.cs
- PropertyFilter.cs
- ActivityInterfaces.cs
- HttpListenerPrefixCollection.cs
- ProcessHostMapPath.cs
- TdsParserSessionPool.cs
- ReferenceEqualityComparer.cs
- MenuItem.cs
- StatusBarPanel.cs
- DefaultTraceListener.cs
- RtfControls.cs
- XamlReader.cs
- ListItemConverter.cs
- InfiniteIntConverter.cs
- Configuration.cs
- CounterSampleCalculator.cs
- InvalidOleVariantTypeException.cs
- RequestResizeEvent.cs
- NTAccount.cs
- ValidatingCollection.cs
- SafeSecurityHandles.cs
- UnsafeNativeMethods.cs
- OleDbTransaction.cs
- XsltLoader.cs
- NodeLabelEditEvent.cs
- EntityDataSourceUtil.cs
- InvalidCastException.cs
- CompareValidator.cs
- Convert.cs
- SoapReflectionImporter.cs
- ProcessThreadCollection.cs
- Listbox.cs
- ApplicationSettingsBase.cs
- ExecutionContext.cs
- EmptyEnumerator.cs
- PersistenceTypeAttribute.cs
- Viewport3DVisual.cs
- KeyFrames.cs
- AccessibleObject.cs
- SponsorHelper.cs
- ParameterElementCollection.cs
- XmlDocumentFragment.cs
- Tile.cs
- SyndicationSerializer.cs
- NestedContainer.cs
- RangeEnumerable.cs
- Int16AnimationBase.cs
- Vector3D.cs
- HelpFileFileNameEditor.cs
- ExpressionEvaluator.cs
- Lease.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- SqlCacheDependencySection.cs
- Blend.cs