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
- MessagePartDescriptionCollection.cs
- Directory.cs
- ScopelessEnumAttribute.cs
- Attachment.cs
- SHA512Cng.cs
- TrustSection.cs
- HasCopySemanticsAttribute.cs
- Binding.cs
- SystemResources.cs
- isolationinterop.cs
- Grant.cs
- PrintControllerWithStatusDialog.cs
- TripleDES.cs
- _Events.cs
- InternalControlCollection.cs
- LinkClickEvent.cs
- SignatureResourceHelper.cs
- CopyOnWriteList.cs
- KeyValuePairs.cs
- RequestValidator.cs
- MemberCollection.cs
- ArrangedElementCollection.cs
- SiteMapSection.cs
- EventLog.cs
- UshortList2.cs
- BinaryObjectReader.cs
- EventRouteFactory.cs
- Rectangle.cs
- FileDialog.cs
- Msec.cs
- Boolean.cs
- CodeLabeledStatement.cs
- NodeInfo.cs
- ServiceObjectContainer.cs
- XmlMembersMapping.cs
- WebEventTraceProvider.cs
- PermissionListSet.cs
- LightweightEntityWrapper.cs
- PagesSection.cs
- WorkflowCommandExtensionItem.cs
- Trace.cs
- XamlToRtfParser.cs
- ByteStreamGeometryContext.cs
- ResourceDictionaryCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- AndCondition.cs
- DeclarativeCatalogPart.cs
- ColorComboBox.cs
- PreviousTrackingServiceAttribute.cs
- PeerHelpers.cs
- DrawingGroup.cs
- MarkupExtensionSerializer.cs
- PartitionedStream.cs
- BaseServiceProvider.cs
- Int64Converter.cs
- ThreadNeutralSemaphore.cs
- CodeNamespaceCollection.cs
- CodeDomExtensionMethods.cs
- AnnotationResource.cs
- HttpPostedFileBase.cs
- AlternateView.cs
- XmlILModule.cs
- ISessionStateStore.cs
- CatalogZoneBase.cs
- EdmProviderManifest.cs
- ViewKeyConstraint.cs
- DesignerMetadata.cs
- GroupItemAutomationPeer.cs
- JsonStringDataContract.cs
- WCFServiceClientProxyGenerator.cs
- DesignerLabelAdapter.cs
- FieldNameLookup.cs
- TextEditorMouse.cs
- SemaphoreSecurity.cs
- NameValuePair.cs
- CdpEqualityComparer.cs
- MachineKeyValidationConverter.cs
- MessageDecoder.cs
- ConstantSlot.cs
- PerformanceCounterPermission.cs
- xmlglyphRunInfo.cs
- LineMetrics.cs
- SchemaCreator.cs
- OdbcRowUpdatingEvent.cs
- ObjectDisposedException.cs
- ImmutableCollection.cs
- Path.cs
- QfeChecker.cs
- SapiRecoInterop.cs
- ScriptManager.cs
- FileSystemEventArgs.cs
- LineGeometry.cs
- XPathNodeList.cs
- translator.cs
- ServiceObjectContainer.cs
- AspNetSynchronizationContext.cs
- ValueHandle.cs
- MetadataPropertyAttribute.cs
- validation.cs
- IriParsingElement.cs