Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / Versioning / MultitargetingHelpers.cs / 1305376 / MultitargetingHelpers.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: MultitargetingHelpers ** **[....] ** ** ** Purpose: Central repository for helpers supporting ** multitargeting, such as emitting the correct version numbers ** and assembly names. ** ** ===========================================================*/ namespace System.Runtime.Versioning { using System; using System.IO; using System.Text; using System.Diagnostics.Contracts; internal static class MultitargetingHelpers { // default type converter private static FuncdefaultConverter = (t) => t.AssemblyQualifiedName; // This method gets assembly info for the corresponding type. If the typeConverter // is provided it is used to get this information. internal static string GetAssemblyQualifiedName(Type type, Func converter) { string assemblyFullName = null; if (type != null) { if (converter != null) { try { assemblyFullName = converter(type); // } catch (Exception e) { if (IsSecurityOrCriticalException(e)) { throw; } } } if (assemblyFullName == null) { assemblyFullName = defaultConverter(type); } } return assemblyFullName; } private static bool IsCriticalException(Exception ex) { return ex is NullReferenceException || ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is IndexOutOfRangeException || ex is AccessViolationException; } private static bool IsSecurityOrCriticalException(Exception ex) { return (ex is System.Security.SecurityException) || IsCriticalException(ex); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DBParameter.cs
- IdentityManager.cs
- DataControlField.cs
- FlowDecision.cs
- SpellerInterop.cs
- BigInt.cs
- PagerStyle.cs
- SqlParameter.cs
- ResourcePart.cs
- TimeSpanStorage.cs
- _AcceptOverlappedAsyncResult.cs
- HttpChannelListener.cs
- SpecularMaterial.cs
- ValidatingReaderNodeData.cs
- DetailsViewPagerRow.cs
- EnvelopedPkcs7.cs
- _DisconnectOverlappedAsyncResult.cs
- CodeTypeConstructor.cs
- BufferedStream.cs
- IconBitmapDecoder.cs
- Monitor.cs
- WindowsContainer.cs
- AttributeProviderAttribute.cs
- BinaryObjectInfo.cs
- contentDescriptor.cs
- TraceUtility.cs
- DocumentPageView.cs
- DetailsViewUpdatedEventArgs.cs
- ButtonBaseAdapter.cs
- SqlSelectClauseBuilder.cs
- ConfigXmlComment.cs
- SignatureToken.cs
- OleDbConnection.cs
- IsolatedStorageFileStream.cs
- HtmlWindow.cs
- DrawingImage.cs
- ExpandableObjectConverter.cs
- CTreeGenerator.cs
- ObjectConverter.cs
- PagedControl.cs
- SqlIdentifier.cs
- EventLogInformation.cs
- ErasingStroke.cs
- Page.cs
- MetadataSource.cs
- TargetFrameworkUtil.cs
- CachedCompositeFamily.cs
- TdsParserSafeHandles.cs
- LOSFormatter.cs
- ExtentJoinTreeNode.cs
- SmtpSection.cs
- MenuItem.cs
- ObjectStateManagerMetadata.cs
- DataDocumentXPathNavigator.cs
- XmlSiteMapProvider.cs
- FontResourceCache.cs
- MasterPageCodeDomTreeGenerator.cs
- ClientBuildManager.cs
- LogSwitch.cs
- diagnosticsswitches.cs
- smtppermission.cs
- Authorization.cs
- ApplicationFileParser.cs
- HttpValueCollection.cs
- BuildProviderAppliesToAttribute.cs
- XmlQualifiedNameTest.cs
- KoreanCalendar.cs
- CommandField.cs
- CodePropertyReferenceExpression.cs
- DelegateBodyWriter.cs
- NavigationHelper.cs
- WindowsSlider.cs
- BindingExpression.cs
- Context.cs
- ScriptControl.cs
- wmiprovider.cs
- ObjectDataSourceView.cs
- ExpressionVisitor.cs
- SoapHeaderAttribute.cs
- ListenerAdapterBase.cs
- mongolianshape.cs
- ToolboxService.cs
- ActivityCodeDomSerializer.cs
- HelloMessageApril2005.cs
- DatatypeImplementation.cs
- DeflateEmulationStream.cs
- EqualityComparer.cs
- MenuScrollingVisibilityConverter.cs
- ValidationEventArgs.cs
- MasterPageBuildProvider.cs
- OleServicesContext.cs
- ResizeBehavior.cs
- ToolStripPanelRenderEventArgs.cs
- ValueProviderWrapper.cs
- StateBag.cs
- ADMembershipProvider.cs
- RoutingChannelExtension.cs
- IndependentAnimationStorage.cs
- FocusTracker.cs
- HitTestWithGeometryDrawingContextWalker.cs