Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Misc / MultitargetUtil.cs / 1305376 / MultitargetUtil.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Resources { using System; ////// Helper class supporting Multitarget type assembly qualified name resolution for ResX API. /// Note: this file is compiled into different assemblies (runtime and VSIP assemblies ...) /// internal static class MultitargetUtil { ////// This method gets assembly info for the corresponding type. If the delegate /// is provided it is used to get this information. /// public static string GetAssemblyQualifiedName(Type type, FunctypeNameConverter) { string assemblyQualifiedName = null; if (type != null) { if (typeNameConverter != null) { try { assemblyQualifiedName = typeNameConverter(type); } catch (Exception e) { if (IsSecurityOrCriticalException(e)) { throw; } } } if (string.IsNullOrEmpty(assemblyQualifiedName)) { assemblyQualifiedName = type.AssemblyQualifiedName; } } return assemblyQualifiedName; } // ExecutionEngineException is obsolete and shouldn't be used (to catch, throw or reference) anymore. // Pragma added to prevent converting the "type is obsolete" warning into build error. #pragma warning disable 618 private static bool IsSecurityOrCriticalException(Exception ex) { return ex is NullReferenceException || ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException || ex is ExecutionEngineException || ex is IndexOutOfRangeException || ex is AccessViolationException || ex is System.Security.SecurityException; } #pragma warning restore 618 } } // 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
- CodeCastExpression.cs
- PropertyMappingExceptionEventArgs.cs
- NoClickablePointException.cs
- ListDictionaryInternal.cs
- ExcludePathInfo.cs
- EncoderParameters.cs
- OrderByQueryOptionExpression.cs
- WriteFileContext.cs
- TextRangeEditLists.cs
- IRCollection.cs
- StateFinalizationDesigner.cs
- DynamicAttribute.cs
- TraceContextRecord.cs
- WebRequestModuleElementCollection.cs
- SystemThemeKey.cs
- LinkArea.cs
- SynchronizingStream.cs
- DataGridSortCommandEventArgs.cs
- WebEventTraceProvider.cs
- WindowsGraphicsWrapper.cs
- ConfigurationElementCollection.cs
- DesignerTextBoxAdapter.cs
- ActivationArguments.cs
- RequestCachePolicyConverter.cs
- ToolStripControlHost.cs
- Highlights.cs
- SQLMoneyStorage.cs
- filewebresponse.cs
- RootBrowserWindowProxy.cs
- RijndaelManaged.cs
- XmlSchemaType.cs
- TextTreeTextNode.cs
- WhitespaceRule.cs
- XsltSettings.cs
- ManifestResourceInfo.cs
- SizeAnimation.cs
- XsdBuilder.cs
- HelpProvider.cs
- UrlMappingCollection.cs
- _ShellExpression.cs
- ClientCultureInfo.cs
- Evidence.cs
- UnhandledExceptionEventArgs.cs
- EventInfo.cs
- ToolBarTray.cs
- IsolatedStorageFile.cs
- XamlReaderHelper.cs
- WebBrowserSiteBase.cs
- AdornerDecorator.cs
- CommonDialog.cs
- LeaseManager.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ToolStripItem.cs
- GeometryModel3D.cs
- TraceContextEventArgs.cs
- GeneralTransform2DTo3DTo2D.cs
- Assert.cs
- MessageHeaderDescription.cs
- ManagementInstaller.cs
- SoapSchemaMember.cs
- validationstate.cs
- ColumnWidthChangedEvent.cs
- MulticastIPAddressInformationCollection.cs
- MaskDescriptors.cs
- ObjectDataSourceEventArgs.cs
- SpellerInterop.cs
- MouseDevice.cs
- DependencyObjectPropertyDescriptor.cs
- AdjustableArrowCap.cs
- MatchSingleFxEngineOpcode.cs
- TransformValueSerializer.cs
- SegmentTree.cs
- XmlComment.cs
- ExceptionDetail.cs
- Splitter.cs
- BulletChrome.cs
- HGlobalSafeHandle.cs
- UnsafeNativeMethods.cs
- WindowsTokenRoleProvider.cs
- DesignerRegion.cs
- XsdBuildProvider.cs
- WebBrowserPermission.cs
- Cloud.cs
- SizeF.cs
- WebGetAttribute.cs
- ScriptControlManager.cs
- DoWorkEventArgs.cs
- TableItemStyle.cs
- CompilerErrorCollection.cs
- AncillaryOps.cs
- Identifier.cs
- LockedBorderGlyph.cs
- TransactionException.cs
- GetImportFileNameRequest.cs
- StrokeDescriptor.cs
- ToolStripPanelRow.cs
- TextServicesCompartmentContext.cs
- EdmPropertyAttribute.cs
- SqlParameter.cs
- GroupStyle.cs