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
- ListDictionaryInternal.cs
- ProgressBarAutomationPeer.cs
- TemplateControl.cs
- ProbeDuplexCD1AsyncResult.cs
- XmlValueConverter.cs
- GlyphRunDrawing.cs
- HandleCollector.cs
- DocumentAutomationPeer.cs
- TrackingConditionCollection.cs
- TextEditor.cs
- SamlAudienceRestrictionCondition.cs
- Transform.cs
- ViewValidator.cs
- BufferedMessageData.cs
- wmiutil.cs
- GatewayDefinition.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- UnsafeNativeMethods.cs
- OrElse.cs
- OutputCacheModule.cs
- ListBindingHelper.cs
- SqlReferenceCollection.cs
- PersonalizationStateInfoCollection.cs
- InheritanceContextChangedEventManager.cs
- SerialReceived.cs
- EntityClientCacheKey.cs
- DESCryptoServiceProvider.cs
- CheckBoxStandardAdapter.cs
- NavigationEventArgs.cs
- TextEditorLists.cs
- MessageBox.cs
- ControlEvent.cs
- DataServiceSaveChangesEventArgs.cs
- ComponentSerializationService.cs
- WsdlBuildProvider.cs
- ArcSegment.cs
- CodeDomConfigurationHandler.cs
- GlyphsSerializer.cs
- DataGridViewSortCompareEventArgs.cs
- AssertSection.cs
- AssemblyAttributesGoHere.cs
- SupportsEventValidationAttribute.cs
- SiblingIterators.cs
- BasicHttpBindingCollectionElement.cs
- StringTraceRecord.cs
- UserInitiatedRoutedEventPermission.cs
- CqlWriter.cs
- DesignTimeTemplateParser.cs
- ConnectionStringSettings.cs
- SocketException.cs
- WebPartConnectionsDisconnectVerb.cs
- GroupBox.cs
- HtmlElementEventArgs.cs
- NewArrayExpression.cs
- DataGridCommandEventArgs.cs
- SamlSecurityToken.cs
- SecurityTokenInclusionMode.cs
- LazyTextWriterCreator.cs
- EditorZoneAutoFormat.cs
- TimeZone.cs
- DesignRelation.cs
- HtmlShim.cs
- controlskin.cs
- BaseCodeDomTreeGenerator.cs
- ExternalException.cs
- GridSplitterAutomationPeer.cs
- XmlDesignerDataSourceView.cs
- SafeProcessHandle.cs
- SafeFileHandle.cs
- DataContractAttribute.cs
- AmbientValueAttribute.cs
- XmlValidatingReaderImpl.cs
- FileChangesMonitor.cs
- FilterElement.cs
- _AutoWebProxyScriptHelper.cs
- Hash.cs
- ACE.cs
- JavaScriptObjectDeserializer.cs
- HttpServerVarsCollection.cs
- MenuItem.cs
- PropertyIDSet.cs
- SelectionItemProviderWrapper.cs
- NamedPipeProcessProtocolHandler.cs
- DescendantBaseQuery.cs
- ObjectAnimationUsingKeyFrames.cs
- ScrollChrome.cs
- SystemWebExtensionsSectionGroup.cs
- WsdlEndpointConversionContext.cs
- HtmlToClrEventProxy.cs
- SqlAliasesReferenced.cs
- UpdateExpressionVisitor.cs
- AutoGeneratedFieldProperties.cs
- PrivilegeNotHeldException.cs
- RegistryConfigurationProvider.cs
- Console.cs
- XmlSchemaDocumentation.cs
- ExecutionEngineException.cs
- GridItemPatternIdentifiers.cs
- EmbeddedMailObjectsCollection.cs
- WebException.cs