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
- InternalBufferOverflowException.cs
- CustomAttributeBuilder.cs
- _AutoWebProxyScriptHelper.cs
- _SSPIWrapper.cs
- ToolboxItemAttribute.cs
- AssemblyBuilder.cs
- CommunicationObjectAbortedException.cs
- OdbcInfoMessageEvent.cs
- ListManagerBindingsCollection.cs
- PeerName.cs
- ReadOnlyDictionary.cs
- DataStreamFromComStream.cs
- EmptyControlCollection.cs
- HttpWebRequest.cs
- CompensatableTransactionScopeActivity.cs
- messageonlyhwndwrapper.cs
- IndentedWriter.cs
- ActiveDocumentEvent.cs
- SoapObjectInfo.cs
- AsyncResult.cs
- CharKeyFrameCollection.cs
- SEHException.cs
- InputBinder.cs
- CultureSpecificCharacterBufferRange.cs
- EdgeModeValidation.cs
- ServiceHostingEnvironmentSection.cs
- InstanceOwnerQueryResult.cs
- Nullable.cs
- UserControlBuildProvider.cs
- DrawingImage.cs
- MimeXmlReflector.cs
- ResourceProviderFactory.cs
- StoragePropertyMapping.cs
- KnownTypesProvider.cs
- TableRowGroup.cs
- RepeatBehaviorConverter.cs
- TextInfo.cs
- StringDictionaryEditor.cs
- XmlDataImplementation.cs
- BaseTemplateCodeDomTreeGenerator.cs
- WebPartZoneBaseDesigner.cs
- ColorTranslator.cs
- BamlLocalizabilityResolver.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- HttpContextServiceHost.cs
- KeyValuePair.cs
- XhtmlBasicPageAdapter.cs
- SettingsBase.cs
- GeometryHitTestResult.cs
- RegisteredDisposeScript.cs
- Size3DConverter.cs
- SQLInt32.cs
- XmlFileEditor.cs
- ControlUtil.cs
- TextElement.cs
- ConfigXmlReader.cs
- OleDbPermission.cs
- NavigationWindowAutomationPeer.cs
- Verify.cs
- ClientSettings.cs
- Vector3DConverter.cs
- OracleCommandSet.cs
- Mappings.cs
- StrokeRenderer.cs
- MatchingStyle.cs
- BufferedWebEventProvider.cs
- DataGridBoolColumn.cs
- AnonymousIdentificationModule.cs
- Activity.cs
- UnmanagedMemoryAccessor.cs
- InternalControlCollection.cs
- ObjectSecurity.cs
- OrthographicCamera.cs
- OracleBFile.cs
- WebControl.cs
- DPTypeDescriptorContext.cs
- _NativeSSPI.cs
- GatewayDefinition.cs
- FrameworkElement.cs
- SrgsGrammar.cs
- Models.cs
- MimeWriter.cs
- CodeArrayCreateExpression.cs
- SafeWaitHandle.cs
- Material.cs
- SmiSettersStream.cs
- StylusOverProperty.cs
- TextEditorParagraphs.cs
- ResourceType.cs
- ProcessManager.cs
- DBCSCodePageEncoding.cs
- ClockController.cs
- DefaultObjectMappingItemCollection.cs
- TrackBarRenderer.cs
- UserMapPath.cs
- WebSysDescriptionAttribute.cs
- Function.cs
- OleDbMetaDataFactory.cs
- ApplicationContext.cs
- DocumentApplication.cs