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
- TemplatePagerField.cs
- SecurityContextSecurityTokenResolver.cs
- ThemeInfoAttribute.cs
- ContextMenu.cs
- TextSearch.cs
- WebPartActionVerb.cs
- OleDbStruct.cs
- HtmlShim.cs
- XmlCharType.cs
- ActivationArguments.cs
- UnsafeNativeMethods.cs
- WmlCommandAdapter.cs
- RawTextInputReport.cs
- DataExpression.cs
- OpCodes.cs
- WindowsComboBox.cs
- wgx_render.cs
- EditorAttribute.cs
- PenContext.cs
- ProxyAttribute.cs
- ExtensionsSection.cs
- CDSCollectionETWBCLProvider.cs
- Thread.cs
- DataGridViewLayoutData.cs
- C14NUtil.cs
- Matrix3DConverter.cs
- XmlAggregates.cs
- Rotation3DAnimationBase.cs
- SecurityPolicySection.cs
- JulianCalendar.cs
- DbParameterHelper.cs
- WebBrowsableAttribute.cs
- ResizeGrip.cs
- ArgumentNullException.cs
- IndicFontClient.cs
- CommentGlyph.cs
- InstanceOwner.cs
- WebBrowserContainer.cs
- PropertyTabChangedEvent.cs
- AuthenticationException.cs
- RedistVersionInfo.cs
- HtmlShim.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SafeWaitHandle.cs
- EventHandlersStore.cs
- ProfileBuildProvider.cs
- Message.cs
- GeneralTransform3DCollection.cs
- DetailsViewDesigner.cs
- CompilerWrapper.cs
- RecordsAffectedEventArgs.cs
- SQLInt32.cs
- ListBoxItemAutomationPeer.cs
- PointAnimationClockResource.cs
- PageThemeParser.cs
- AstNode.cs
- VectorCollection.cs
- LinqMaximalSubtreeNominator.cs
- Binding.cs
- TextElementAutomationPeer.cs
- ServiceTimeoutsBehavior.cs
- SmtpReplyReader.cs
- ProfilePropertyNameValidator.cs
- MessageEncodingBindingElementImporter.cs
- ButtonPopupAdapter.cs
- XmlAutoDetectWriter.cs
- MDIClient.cs
- DbProviderConfigurationHandler.cs
- DataGridView.cs
- GlobalEventManager.cs
- VersionedStreamOwner.cs
- KeyToListMap.cs
- MenuItemStyle.cs
- Header.cs
- TextLine.cs
- SqlStream.cs
- XmlWrappingReader.cs
- ThousandthOfEmRealDoubles.cs
- QueryCacheKey.cs
- XPathDocumentBuilder.cs
- MatrixValueSerializer.cs
- ContextConfiguration.cs
- DriveInfo.cs
- DataObjectCopyingEventArgs.cs
- UpdateTracker.cs
- WebPartDeleteVerb.cs
- ConnectionManagementElementCollection.cs
- CodeCompiler.cs
- PropertyToken.cs
- FileSystemInfo.cs
- Empty.cs
- SqlDataSourceSelectingEventArgs.cs
- SQLDoubleStorage.cs
- UnhandledExceptionEventArgs.cs
- Evidence.cs
- SelectionListComponentEditor.cs
- RuntimeConfigLKG.cs
- Single.cs
- ClientConfigurationSystem.cs
- DataGridViewCellCollection.cs