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
- InvalidCastException.cs
- smtppermission.cs
- FormattedTextSymbols.cs
- ArraySubsetEnumerator.cs
- DummyDataSource.cs
- FixedStringLookup.cs
- StrongNameMembershipCondition.cs
- OutputCacheProfileCollection.cs
- Emitter.cs
- InternalConfigEventArgs.cs
- KeyedHashAlgorithm.cs
- DbProviderFactory.cs
- Vector3DIndependentAnimationStorage.cs
- TransactionScopeDesigner.cs
- ToolboxItemCollection.cs
- HttpModuleActionCollection.cs
- KeyboardEventArgs.cs
- SoapAttributeAttribute.cs
- BitmapData.cs
- ProviderBase.cs
- DataGridBoolColumn.cs
- SpinLock.cs
- _NestedSingleAsyncResult.cs
- AutomationElementIdentifiers.cs
- StickyNoteContentControl.cs
- CatalogZone.cs
- SystemUdpStatistics.cs
- StrokeNode.cs
- FtpWebResponse.cs
- Rotation3DKeyFrameCollection.cs
- DbgUtil.cs
- CompilerInfo.cs
- ChangeTracker.cs
- OdbcParameterCollection.cs
- RadioButtonList.cs
- ExpandCollapseProviderWrapper.cs
- XsdDuration.cs
- ParserOptions.cs
- EntityCommandExecutionException.cs
- EntityDataSourceSelectingEventArgs.cs
- NameObjectCollectionBase.cs
- DataServiceQueryOfT.cs
- RootDesignerSerializerAttribute.cs
- TextBoxLine.cs
- TableLayout.cs
- ResourceDescriptionAttribute.cs
- BindingBase.cs
- TypeInformation.cs
- SqlConnectionManager.cs
- InertiaExpansionBehavior.cs
- shaperfactory.cs
- StorageAssociationTypeMapping.cs
- SessionIDManager.cs
- Decimal.cs
- Transaction.cs
- DesignerActionUIStateChangeEventArgs.cs
- ListDataBindEventArgs.cs
- CursorConverter.cs
- DbDataRecord.cs
- WebControl.cs
- AuthorizationRule.cs
- CompositeFontParser.cs
- HelpInfo.cs
- DesignerCommandAdapter.cs
- ApplicationProxyInternal.cs
- ParsedAttributeCollection.cs
- XmlTypeAttribute.cs
- DependencyPropertyChangedEventArgs.cs
- CheckBoxRenderer.cs
- TrackingProfileDeserializationException.cs
- ConfigPathUtility.cs
- EventDescriptor.cs
- OleDbMetaDataFactory.cs
- SettingsContext.cs
- CompiledELinqQueryState.cs
- EmptyEnumerator.cs
- MediaTimeline.cs
- StringFreezingAttribute.cs
- BaseTreeIterator.cs
- UnsafeNativeMethods.cs
- Facet.cs
- DocumentViewerBase.cs
- BrowserTree.cs
- CheckoutException.cs
- StylusPointDescription.cs
- UIElement.cs
- _SslState.cs
- SystemIPv4InterfaceProperties.cs
- Highlights.cs
- PriorityBinding.cs
- ExpressionDumper.cs
- Crypto.cs
- PartitionResolver.cs
- Vector.cs
- TextServicesContext.cs
- NodeLabelEditEvent.cs
- PropertyChangeTracker.cs
- RegexBoyerMoore.cs
- BatchParser.cs
- XmlTypeMapping.cs