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
- NativeActivity.cs
- fixedPageContentExtractor.cs
- SmiEventStream.cs
- FixedPageAutomationPeer.cs
- COM2IDispatchConverter.cs
- Logging.cs
- HttpBindingExtension.cs
- FolderBrowserDialogDesigner.cs
- SplashScreenNativeMethods.cs
- EntityContainerEmitter.cs
- SamlSecurityToken.cs
- SystemWebCachingSectionGroup.cs
- DependencyPropertyHelper.cs
- ACL.cs
- TransportElement.cs
- LockRenewalTask.cs
- CqlBlock.cs
- SiteMapDataSourceView.cs
- NumberAction.cs
- _FtpDataStream.cs
- CoTaskMemHandle.cs
- HitTestFilterBehavior.cs
- TriggerCollection.cs
- SignedXml.cs
- basenumberconverter.cs
- VersionPair.cs
- ResourceCategoryAttribute.cs
- DataViewSettingCollection.cs
- AssemblyHelper.cs
- ChangeDirector.cs
- BuiltInPermissionSets.cs
- BuilderPropertyEntry.cs
- RegexRunner.cs
- PrimitiveRenderer.cs
- TreeNodeStyle.cs
- XmlEncodedRawTextWriter.cs
- PolicyDesigner.cs
- DoubleAverageAggregationOperator.cs
- OptimisticConcurrencyException.cs
- HighContrastHelper.cs
- FlowDocument.cs
- ObjectSecurity.cs
- LockRecursionException.cs
- ModuleBuilderData.cs
- StylusCaptureWithinProperty.cs
- DictionaryGlobals.cs
- DataPagerFieldItem.cs
- FtpWebResponse.cs
- OutputCacheSettings.cs
- SerTrace.cs
- DecimalFormatter.cs
- FormView.cs
- MediaContextNotificationWindow.cs
- SafeMemoryMappedFileHandle.cs
- WorkflowItemPresenter.cs
- HeaderedContentControl.cs
- ArgIterator.cs
- EmptyImpersonationContext.cs
- DbTransaction.cs
- GeometryConverter.cs
- BindingUtils.cs
- InkCanvasSelection.cs
- Expression.cs
- PolicyValidator.cs
- RSAPKCS1SignatureFormatter.cs
- ShadowGlyph.cs
- safesecurityhelperavalon.cs
- StringExpressionSet.cs
- RectValueSerializer.cs
- ClientRolePrincipal.cs
- Point.cs
- SiteIdentityPermission.cs
- WeakReadOnlyCollection.cs
- PolicyException.cs
- WmfPlaceableFileHeader.cs
- ClockController.cs
- StylusEventArgs.cs
- XmlDataSourceView.cs
- Logging.cs
- RemotingConfiguration.cs
- ToolStripDropDownMenu.cs
- Rotation3D.cs
- UnsettableComboBox.cs
- FilterException.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- PrivilegedConfigurationManager.cs
- QueryLifecycle.cs
- CollectionChange.cs
- Translator.cs
- SynchronizingStream.cs
- FileClassifier.cs
- DataGridViewSelectedCellCollection.cs
- CharacterHit.cs
- ToolStripItem.cs
- httpstaticobjectscollection.cs
- BrowserCapabilitiesFactoryBase.cs
- HttpHeaderCollection.cs
- XXXInfos.cs
- TextModifier.cs
- DesignTimeVisibleAttribute.cs