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
- SerializationSectionGroup.cs
- CallContext.cs
- SQLDecimal.cs
- ExpressionBinding.cs
- X509Certificate.cs
- DataGridColumnCollection.cs
- rsa.cs
- Base64Encoding.cs
- DocumentViewerBaseAutomationPeer.cs
- PrePostDescendentsWalker.cs
- DataTrigger.cs
- CurrencyWrapper.cs
- ScriptIgnoreAttribute.cs
- TextWriterTraceListener.cs
- SByteConverter.cs
- PopupRoot.cs
- VideoDrawing.cs
- CodeLabeledStatement.cs
- WebResourceUtil.cs
- SqlMethodTransformer.cs
- ProviderBase.cs
- DataControlFieldHeaderCell.cs
- controlskin.cs
- ChannelServices.cs
- DataGridTemplateColumn.cs
- FixedElement.cs
- EncodingNLS.cs
- ConfigXmlWhitespace.cs
- HandleRef.cs
- XmlWhitespace.cs
- mil_commands.cs
- DataGridViewComboBoxColumn.cs
- DocumentReferenceCollection.cs
- UIElementPropertyUndoUnit.cs
- RunInstallerAttribute.cs
- WebPartConnectionsCloseVerb.cs
- PropertyItem.cs
- UnionCqlBlock.cs
- Trace.cs
- ExpandableObjectConverter.cs
- HttpModuleActionCollection.cs
- Size3D.cs
- TypeConverterHelper.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- KnownBoxes.cs
- ComProxy.cs
- ProcessInputEventArgs.cs
- WorkflowApplicationIdleEventArgs.cs
- ReadOnlyObservableCollection.cs
- Int64AnimationBase.cs
- KerberosReceiverSecurityToken.cs
- XPathParser.cs
- XmlAnyElementAttribute.cs
- StatusBarDrawItemEvent.cs
- ArgumentsParser.cs
- PreservationFileReader.cs
- SerialPort.cs
- HttpConfigurationContext.cs
- MulticastIPAddressInformationCollection.cs
- MsmqIntegrationBindingCollectionElement.cs
- TimelineGroup.cs
- BypassElementCollection.cs
- GeneralTransform3D.cs
- EdmProviderManifest.cs
- ConnectionConsumerAttribute.cs
- ClientConfigPaths.cs
- BamlLocalizationDictionary.cs
- EventLogPermissionAttribute.cs
- TabPanel.cs
- ScrollChrome.cs
- XPathDocumentNavigator.cs
- SafeViewOfFileHandle.cs
- TreeView.cs
- MediaElement.cs
- DataGridColumnEventArgs.cs
- TaskFileService.cs
- Menu.cs
- WebEventTraceProvider.cs
- TCPClient.cs
- Int64KeyFrameCollection.cs
- EventLogInformation.cs
- XmlNodeList.cs
- UndoEngine.cs
- BinaryMethodMessage.cs
- StatusStrip.cs
- CharEntityEncoderFallback.cs
- WebHeaderCollection.cs
- WsdlInspector.cs
- CaseStatementSlot.cs
- CommandSet.cs
- ScriptHandlerFactory.cs
- HtmlTableRowCollection.cs
- Attributes.cs
- Win32SafeHandles.cs
- ConsoleEntryPoint.cs
- ItemChangedEventArgs.cs
- MdiWindowListStrip.cs
- UInt64Storage.cs
- SqlCrossApplyToCrossJoin.cs
- WizardPanel.cs