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
- PresentationAppDomainManager.cs
- PageParserFilter.cs
- TextModifier.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- XmlSchemaAll.cs
- InputEventArgs.cs
- AssemblyName.cs
- ContextMenuStrip.cs
- ResourceReferenceKeyNotFoundException.cs
- ContextTokenTypeConverter.cs
- Renderer.cs
- PreProcessInputEventArgs.cs
- ASCIIEncoding.cs
- SafePEFileHandle.cs
- XmlSchemaInfo.cs
- Encoding.cs
- BinaryMessageEncodingElement.cs
- Nodes.cs
- WorkflowOperationInvoker.cs
- InputScope.cs
- EdmItemCollection.cs
- AQNBuilder.cs
- DeploymentSectionCache.cs
- AlternateViewCollection.cs
- FileDialogCustomPlace.cs
- RouteItem.cs
- InternalResources.cs
- SpeakProgressEventArgs.cs
- CodeCommentStatement.cs
- CreateUserErrorEventArgs.cs
- FontFaceLayoutInfo.cs
- ParameterToken.cs
- TextFormatterImp.cs
- BaseComponentEditor.cs
- Stopwatch.cs
- XmlAttributeProperties.cs
- SmtpFailedRecipientException.cs
- WorkflowInstance.cs
- TypedCompletedAsyncResult.cs
- CodeExporter.cs
- externdll.cs
- WebBrowserNavigatedEventHandler.cs
- XmlDataProvider.cs
- UIAgentRequest.cs
- Attributes.cs
- DataGridCommandEventArgs.cs
- SecureEnvironment.cs
- ScriptingProfileServiceSection.cs
- Italic.cs
- TrackingMemoryStream.cs
- ImageFormatConverter.cs
- DataGridViewCellParsingEventArgs.cs
- InvalidateEvent.cs
- OdbcConnectionOpen.cs
- TimelineGroup.cs
- MiniCustomAttributeInfo.cs
- XmlEntity.cs
- JsonDeserializer.cs
- XmlSchemaObjectTable.cs
- ClientUrlResolverWrapper.cs
- SelectedGridItemChangedEvent.cs
- MatrixUtil.cs
- ToolStripSeparatorRenderEventArgs.cs
- HebrewCalendar.cs
- namescope.cs
- DataKey.cs
- MetadataFile.cs
- QueryTaskGroupState.cs
- MappedMetaModel.cs
- ImageMetadata.cs
- ProgressBarRenderer.cs
- _NegotiateClient.cs
- DecoderFallback.cs
- DocumentOrderQuery.cs
- EventTrigger.cs
- storepermissionattribute.cs
- InputLanguageManager.cs
- Types.cs
- AnimationStorage.cs
- Debugger.cs
- WebScriptEndpointElement.cs
- TextLineResult.cs
- ServiceBuildProvider.cs
- Stylesheet.cs
- TextRangeEdit.cs
- LocalizationParserHooks.cs
- BigInt.cs
- followingquery.cs
- LiteralDesigner.cs
- PartialArray.cs
- InternalConfigEventArgs.cs
- BlurBitmapEffect.cs
- ReturnEventArgs.cs
- PeerNameRecord.cs
- ProxyWebPartConnectionCollection.cs
- UnsafeNativeMethods.cs
- ComplexBindingPropertiesAttribute.cs
- ConfigurationElement.cs
- RadioButton.cs
- XamlSerializerUtil.cs