Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / ExceptionTranslationTable.cs / 1 / ExceptionTranslationTable.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Runtime.InteropServices; using System.Security; using System.Security.Principal; using System.IO; using Microsoft.InfoCards.Diagnostics; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // This is the table that associates a non InfoCard exception with an HResult. // internal sealed class ExceptionTranslationTable { Dictionary< Type, int > m_table; static ExceptionTranslationTable s_thisTable; public static ExceptionTranslationTable Instance { get { if ( null == s_thisTable ) { s_thisTable = new ExceptionTranslationTable(); } return s_thisTable; } } private ExceptionTranslationTable() { // // Add new translations here. // m_table = new Dictionary< Type, int >(); // // Please use HRESULTS ONLY. // m_table.Add( typeof( ApplicationException ), NativeMethods.COR_E_APPLICATION ); m_table.Add( typeof( InvalidOperationException ), (int)EventCode.E_ICARD_COMMUNICATION ); m_table.Add( typeof( NotImplementedException ), NativeMethods.E_NOTIMPL ); m_table.Add( typeof( SecurityException ), NativeMethods.E_ACCESSDENIED ); } // // Summary: // Returns the hresult for a particular exception type. // public int this[ Type key ] { get { return m_table[ key ]; } } // // Summary: // returns whether the key is contained in the table. // public bool ContainsKey( Type key ) { return m_table.ContainsKey( key ); } } } // 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
- QilFactory.cs
- Subtract.cs
- GridViewDesigner.cs
- HtmlPanelAdapter.cs
- HyperlinkAutomationPeer.cs
- DataServiceHost.cs
- ObjectViewListener.cs
- UnicastIPAddressInformationCollection.cs
- BlockCollection.cs
- DiscoveryClient.cs
- XpsViewerException.cs
- CacheModeConverter.cs
- NameTable.cs
- EmbeddedObject.cs
- Region.cs
- WebPartAddingEventArgs.cs
- InnerItemCollectionView.cs
- StructureChangedEventArgs.cs
- ObjectTokenCategory.cs
- serverconfig.cs
- GroupItem.cs
- FontFamilyIdentifier.cs
- TextOptionsInternal.cs
- CacheSection.cs
- infer.cs
- BeginEvent.cs
- PassportAuthenticationModule.cs
- RotateTransform.cs
- PinnedBufferMemoryStream.cs
- EdmConstants.cs
- TextureBrush.cs
- EditBehavior.cs
- ViewValidator.cs
- RelationshipManager.cs
- GridViewColumnHeaderAutomationPeer.cs
- TreeNode.cs
- RegexGroupCollection.cs
- UIServiceHelper.cs
- OperationValidationEventArgs.cs
- AdRotatorDesigner.cs
- ObjectListField.cs
- HttpCookiesSection.cs
- StylusEventArgs.cs
- VirtualizedItemProviderWrapper.cs
- DependencyPropertyDescriptor.cs
- Constraint.cs
- ReturnType.cs
- ScrollBarRenderer.cs
- GraphicsContainer.cs
- ModelFactory.cs
- IndicCharClassifier.cs
- SafeNativeHandle.cs
- TCEAdapterGenerator.cs
- TextureBrush.cs
- SqlStatistics.cs
- SHA384CryptoServiceProvider.cs
- IResourceProvider.cs
- OdbcHandle.cs
- ScrollPattern.cs
- SignatureSummaryDialog.cs
- SQLInt32Storage.cs
- BuilderPropertyEntry.cs
- SqlConnectionFactory.cs
- ObjectViewEntityCollectionData.cs
- OleDbTransaction.cs
- OracleParameterCollection.cs
- ValueTable.cs
- HostingPreferredMapPath.cs
- SerializationInfo.cs
- DocumentEventArgs.cs
- ScrollViewerAutomationPeer.cs
- AsyncOperation.cs
- Geometry3D.cs
- EtwTrackingBehavior.cs
- Pkcs7Signer.cs
- NeutralResourcesLanguageAttribute.cs
- ListItemCollection.cs
- BindingExpressionUncommonField.cs
- DrawToolTipEventArgs.cs
- CustomSignedXml.cs
- TextLineBreak.cs
- DSACryptoServiceProvider.cs
- RayMeshGeometry3DHitTestResult.cs
- DataGridViewToolTip.cs
- CodeDOMUtility.cs
- SEHException.cs
- CollectionView.cs
- ObjectTag.cs
- UnsafeNativeMethodsCLR.cs
- BaseValidator.cs
- InvokeGenerator.cs
- PolygonHotSpot.cs
- baseaxisquery.cs
- DesignerTransactionCloseEvent.cs
- CompiledQuery.cs
- SqlConnectionPoolProviderInfo.cs
- XmlLanguageConverter.cs
- TextPatternIdentifiers.cs
- Codec.cs
- CultureTableRecord.cs