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
- CodeBlockBuilder.cs
- mongolianshape.cs
- BmpBitmapEncoder.cs
- ExpressionConverter.cs
- Accessible.cs
- StreamUpdate.cs
- IIS7WorkerRequest.cs
- _OverlappedAsyncResult.cs
- InkCanvas.cs
- XmlText.cs
- SqlXmlStorage.cs
- BoolExpression.cs
- ScrollViewer.cs
- WorkflowDesigner.cs
- SamlSerializer.cs
- EnumConverter.cs
- FeatureSupport.cs
- ExpressionConverter.cs
- IPHostEntry.cs
- InlinedAggregationOperator.cs
- IndexedGlyphRun.cs
- DataGridColumnStyleMappingNameEditor.cs
- ValidationSummaryDesigner.cs
- SchemaTypeEmitter.cs
- StringBuilder.cs
- TdsEnums.cs
- Substitution.cs
- diagnosticsswitches.cs
- XmlNode.cs
- ContextQuery.cs
- CodeTypeReferenceExpression.cs
- StandardBindingImporter.cs
- EventLog.cs
- TreeViewImageKeyConverter.cs
- EntityDataSourceWrapper.cs
- CompressEmulationStream.cs
- SiteMap.cs
- PropertyPathWorker.cs
- Propagator.cs
- SecurityContextCookieSerializer.cs
- HitTestWithGeometryDrawingContextWalker.cs
- PropertyValueUIItem.cs
- listviewsubitemcollectioneditor.cs
- XmlDownloadManager.cs
- ElementFactory.cs
- DrawItemEvent.cs
- Avt.cs
- MeasureData.cs
- GiveFeedbackEventArgs.cs
- IIS7WorkerRequest.cs
- TextClipboardData.cs
- OpacityConverter.cs
- UntrustedRecipientException.cs
- HttpApplicationFactory.cs
- SqlErrorCollection.cs
- SecurityPolicySection.cs
- XmlQualifiedNameTest.cs
- SchemeSettingElementCollection.cs
- SessionStateSection.cs
- UnsafeNativeMethods.cs
- LateBoundBitmapDecoder.cs
- VersionedStreamOwner.cs
- FlowLayoutSettings.cs
- FontNameEditor.cs
- TaskForm.cs
- HMACMD5.cs
- GeneralTransform3DCollection.cs
- AsyncStreamReader.cs
- SBCSCodePageEncoding.cs
- AttributeCollection.cs
- Models.cs
- ScriptMethodAttribute.cs
- UshortList2.cs
- AssemblyHash.cs
- ResolvedKeyFrameEntry.cs
- WebPartVerb.cs
- WebPartUserCapability.cs
- UIPropertyMetadata.cs
- ArgumentNullException.cs
- MouseEvent.cs
- Rect3DValueSerializer.cs
- HtmlInputText.cs
- WebPartDisplayModeCancelEventArgs.cs
- CallTemplateAction.cs
- StrokeRenderer.cs
- ExpressionWriter.cs
- SystemIPGlobalProperties.cs
- FacetChecker.cs
- FieldToken.cs
- CodeDirectoryCompiler.cs
- Matrix3DStack.cs
- FamilyCollection.cs
- UpDownEvent.cs
- LookupNode.cs
- AnnotationAuthorChangedEventArgs.cs
- SharedConnectionListener.cs
- SqlConnectionPoolGroupProviderInfo.cs
- WpfKnownMember.cs
- RefreshInfo.cs
- RowBinding.cs