Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / MS / Internal / FontCache / ElementFactory.cs / 1 / ElementFactory.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Diagnostics; using System.IO; using System.Net; using System.Security; using MS.Internal.PresentationCore; // Since we disable PreSharp warnings in this file, we first need to disable warnings about unknown message numbers and unknown pragmas. #pragma warning disable 1634, 1691 // Disable PreSharp warning about empty catch bodies. // We have many situations in this file where the service needs to robust against external data, // and empty catch bodies allow for uniform error handling code paths. #pragma warning disable 6502 namespace MS.Internal.FontCache { ////// Critical - The class is used by the server to construct font cache elements. /// It is unaware of what method will be used to communicate the data to the server. /// [SecurityCritical(SecurityCriticalScope.Everything)] [FriendAccessAllowed] internal static class ElementFactory { ////// Creates an element from a miss report key. Checks for errors in element construction /// that could arise if either key or font file is corrupt. Returns the element if successful /// or null to indicate an error. /// internal static IFontCacheElement CreateElementFromKey(int type, CheckedPointer key) { try { switch (type) { case 2: return new FamilyCollection(key); case 3: return new FontFaceLayoutInfo(key); case 1: return new GlyphBitmapElement(key); case 4: return new GlyphPathElement(key); default: return null; } } catch (ArgumentOutOfRangeException) { // The cache element key is malformed. } catch (UriFormatException) { // Font file Uri is malformed. } catch (IOException) { // Font file doesn't exist or cannot be read due to an I/O error. } catch (UnauthorizedAccessException) { // Font file cannot be accessed by the service account. } catch (WebException) { //This error can happen if the miss report specifies a web address for the font file. //(This is not a subclass of I/O exception). } return null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContentPlaceHolder.cs
- EventLogInformation.cs
- PasswordRecoveryAutoFormat.cs
- TimeoutStream.cs
- counter.cs
- GlobalAllocSafeHandle.cs
- DesignerGeometryHelper.cs
- CheckBoxList.cs
- DetailsViewPagerRow.cs
- ResourceReferenceExpression.cs
- CachedFontFamily.cs
- DirectoryInfo.cs
- Style.cs
- RectAnimationClockResource.cs
- FloaterParagraph.cs
- AliasExpr.cs
- MergePropertyDescriptor.cs
- ReflectPropertyDescriptor.cs
- ResolvedKeyFrameEntry.cs
- AuthenticationManager.cs
- SetState.cs
- BamlMapTable.cs
- Int32AnimationBase.cs
- DataGridrowEditEndingEventArgs.cs
- SendActivity.cs
- DataBindingCollection.cs
- Soap.cs
- SequenceDesignerAccessibleObject.cs
- ContentPlaceHolder.cs
- TextElement.cs
- KnownBoxes.cs
- JsonFormatReaderGenerator.cs
- Math.cs
- EventlogProvider.cs
- CriticalExceptions.cs
- OdbcHandle.cs
- DataTablePropertyDescriptor.cs
- WebHttpElement.cs
- MenuEventArgs.cs
- SqlTriggerContext.cs
- BamlLocalizabilityResolver.cs
- IntSecurity.cs
- AdapterUtil.cs
- SettingsPropertyWrongTypeException.cs
- AssociatedControlConverter.cs
- FilteredReadOnlyMetadataCollection.cs
- ClassImporter.cs
- AssociationProvider.cs
- SimpleWorkerRequest.cs
- DiscreteKeyFrames.cs
- XamlContextStack.cs
- XmlElementCollection.cs
- ListControl.cs
- CodeEntryPointMethod.cs
- Stopwatch.cs
- ErrorHandler.cs
- QilReplaceVisitor.cs
- CorrelationResolver.cs
- BuildDependencySet.cs
- Accessible.cs
- InlineUIContainer.cs
- CopyNamespacesAction.cs
- ContainerVisual.cs
- EntityCollection.cs
- RtfToken.cs
- ResourceContainer.cs
- DesignerFrame.cs
- TdsEnums.cs
- Token.cs
- ProxyHelper.cs
- AsnEncodedData.cs
- CheckoutException.cs
- TagMapInfo.cs
- ResourceSetExpression.cs
- CollectionViewGroupInternal.cs
- CodeIdentifiers.cs
- HandledMouseEvent.cs
- UnionCqlBlock.cs
- ContextMenu.cs
- HttpServerUtilityBase.cs
- FontFamily.cs
- XmlIgnoreAttribute.cs
- SqlDataSourceCustomCommandEditor.cs
- XPathSingletonIterator.cs
- InheritablePropertyChangeInfo.cs
- PersonalizationEntry.cs
- OutputCacheSection.cs
- FormsAuthenticationConfiguration.cs
- GenericIdentity.cs
- FixedPageProcessor.cs
- GlobalEventManager.cs
- MouseCaptureWithinProperty.cs
- GcSettings.cs
- DbProviderFactories.cs
- PermissionSetEnumerator.cs
- ByteStreamMessage.cs
- RegexStringValidatorAttribute.cs
- COM2IProvidePropertyBuilderHandler.cs
- DocumentPageViewAutomationPeer.cs
- ReadOnlyHierarchicalDataSourceView.cs