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
- UseLicense.cs
- Currency.cs
- Mapping.cs
- Barrier.cs
- CallSiteOps.cs
- EntitySqlQueryCacheKey.cs
- CapacityStreamGeometryContext.cs
- SchemaAttDef.cs
- StoragePropertyMapping.cs
- StickyNote.cs
- SizeFConverter.cs
- DiscoveryInnerClientManaged11.cs
- FunctionMappingTranslator.cs
- XsltException.cs
- BindingMAnagerBase.cs
- MoveSizeWinEventHandler.cs
- PageBuildProvider.cs
- RemoteHelper.cs
- EncodingInfo.cs
- SchemaMapping.cs
- DataKeyCollection.cs
- XmlQueryTypeFactory.cs
- XmlLinkedNode.cs
- ConnectionsZone.cs
- ValueTable.cs
- RoleService.cs
- MailHeaderInfo.cs
- DateTimeFormatInfo.cs
- FormViewPageEventArgs.cs
- EventBindingService.cs
- ContextInformation.cs
- WorkflowServiceHost.cs
- MatchingStyle.cs
- XmlSequenceWriter.cs
- WmlLiteralTextAdapter.cs
- xml.cs
- ReferenceEqualityComparer.cs
- ConstructorBuilder.cs
- SHA512Cng.cs
- EditorPartChrome.cs
- StrokeNodeEnumerator.cs
- TcpChannelHelper.cs
- BadImageFormatException.cs
- RuntimeHandles.cs
- XmlSchemaAll.cs
- SeverityFilter.cs
- SourceItem.cs
- ScrollProviderWrapper.cs
- XmlSchemaCompilationSettings.cs
- StylusPlugin.cs
- SpellerError.cs
- CfgSemanticTag.cs
- ServerTooBusyException.cs
- ToolStripItemCollection.cs
- ClassImporter.cs
- XmlDocument.cs
- HtmlInputReset.cs
- DbExpressionVisitor_TResultType.cs
- DateTime.cs
- Debugger.cs
- remotingproxy.cs
- EntityUtil.cs
- KeyMatchBuilder.cs
- UInt16.cs
- File.cs
- TextTreeTextElementNode.cs
- ParentQuery.cs
- SByteStorage.cs
- DataListItemCollection.cs
- Expression.cs
- diagnosticsswitches.cs
- BigInt.cs
- NetworkCredential.cs
- NonParentingControl.cs
- AssemblyEvidenceFactory.cs
- SqlUdtInfo.cs
- List.cs
- FloaterBaseParaClient.cs
- objectquery_tresulttype.cs
- ToolZoneDesigner.cs
- AsmxEndpointPickerExtension.cs
- SmiMetaDataProperty.cs
- HwndAppCommandInputProvider.cs
- WebPartConnectVerb.cs
- DataServices.cs
- CollectionChangeEventArgs.cs
- GeneralTransform.cs
- CodeFieldReferenceExpression.cs
- ExpressionWriter.cs
- NavigateEvent.cs
- KoreanCalendar.cs
- LinearGradientBrush.cs
- XmlSchemaExternal.cs
- Converter.cs
- QueryNode.cs
- HyperLinkField.cs
- DBAsyncResult.cs
- DataSourceSelectArguments.cs
- ViewManagerAttribute.cs
- SettingsPropertyIsReadOnlyException.cs