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
- HtmlContainerControl.cs
- XmlEncodedRawTextWriter.cs
- CompilationLock.cs
- GlyphElement.cs
- DataBindingExpressionBuilder.cs
- SqlMetaData.cs
- CalculatedColumn.cs
- QueueProcessor.cs
- XmlNode.cs
- HtmlProps.cs
- MsmqAuthenticationMode.cs
- LiteralControl.cs
- ItemCheckEvent.cs
- TriggerBase.cs
- ResizingMessageFilter.cs
- AbstractSvcMapFileLoader.cs
- FieldDescriptor.cs
- ArraySet.cs
- TextBox.cs
- Models.cs
- Highlights.cs
- PtsContext.cs
- ReaderWriterLock.cs
- AuthenticatingEventArgs.cs
- WebEventCodes.cs
- ExpressionBuilderContext.cs
- EnglishPluralizationService.cs
- StreamGeometry.cs
- DocumentOrderQuery.cs
- WebBrowserSiteBase.cs
- DesignerSerializationOptionsAttribute.cs
- safex509handles.cs
- BitmapSourceSafeMILHandle.cs
- ColumnMap.cs
- ChangesetResponse.cs
- CodeCompiler.cs
- KnownIds.cs
- ThumbButtonInfoCollection.cs
- MDIClient.cs
- HelpProvider.cs
- WebException.cs
- CheckPair.cs
- SettingsAttributeDictionary.cs
- SystemSounds.cs
- ValueType.cs
- FreezableDefaultValueFactory.cs
- Deflater.cs
- ProxySimple.cs
- BezierSegment.cs
- TableLayoutColumnStyleCollection.cs
- PropertyTabChangedEvent.cs
- QueryOutputWriter.cs
- StrokeSerializer.cs
- ExtendedPropertyDescriptor.cs
- IteratorDescriptor.cs
- SvcMapFileLoader.cs
- SspiHelper.cs
- TypeExtension.cs
- XmlBinaryReader.cs
- StateMachineWorkflow.cs
- DataGridViewCellStyleConverter.cs
- RoleManagerModule.cs
- MexBindingBindingCollectionElement.cs
- NullNotAllowedCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- BitmapCacheBrush.cs
- IntSecurity.cs
- ApplicationException.cs
- SubpageParagraph.cs
- ColorAnimationUsingKeyFrames.cs
- MeasurementDCInfo.cs
- ValuePatternIdentifiers.cs
- FormViewDeletedEventArgs.cs
- PreloadedPackages.cs
- QueryStringHandler.cs
- Single.cs
- CalendarDateChangedEventArgs.cs
- Options.cs
- SQLInt64.cs
- DesignerLoader.cs
- DispatchChannelSink.cs
- DataGridViewCellFormattingEventArgs.cs
- CdpEqualityComparer.cs
- ArglessEventHandlerProxy.cs
- ToolStripOverflow.cs
- HelloOperation11AsyncResult.cs
- DPAPIProtectedConfigurationProvider.cs
- BitmapEffectGroup.cs
- DataControlField.cs
- TreeIterator.cs
- GradientStop.cs
- KerberosTicketHashIdentifierClause.cs
- DataGridTextBoxColumn.cs
- LambdaExpression.cs
- XappLauncher.cs
- EdmToObjectNamespaceMap.cs
- ConfigXmlSignificantWhitespace.cs
- DiscoveryServerProtocol.cs
- AdCreatedEventArgs.cs
- CancelEventArgs.cs