Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / CardSpaceException.cs / 1305376 / CardSpaceException.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Runtime.Serialization; using Microsoft.InfoCards.Diagnostics; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; using Microsoft.InfoCards; internal static class ExceptionHelper { public static void ThrowIfCardSpaceException( int status ) { switch( status ) { case (int)EventCode.E_ICARD_COMMUNICATION: throw IDT.ThrowHelperError( new CardSpaceException( SR.GetString( SR.ClientAPIInfocardError ) ) ); case (int)EventCode.E_ICARD_USERCANCELLED: throw IDT.ThrowHelperError( new UserCancellationException( SR.GetString( SR.ClientAPIUserCancellationError ) ) ); case (int)EventCode.E_ICARD_SERVICE: throw IDT.ThrowHelperError( new ServiceNotStartedException( SR.GetString( SR.ClientAPIServiceNotStartedError ) ) ); case (int)EventCode.E_ICARD_UNTRUSTED: throw IDT.ThrowHelperError( new UntrustedRecipientException( SR.GetString( SR.ClientAPIUntrustedRecipientError ) ) ); case (int)EventCode.E_ICARD_TRUSTEXCHANGE: throw IDT.ThrowHelperError( new StsCommunicationException( SR.GetString( SR.ClientStsCommunicationException ) ) ); case (int)EventCode.E_ICARD_IDENTITY: throw IDT.ThrowHelperError( new IdentityValidationException( SR.GetString( SR.ClientAPIInvalidIdentity ) ) ); case (int)EventCode.E_ICARD_SERVICEBUSY: throw IDT.ThrowHelperError( new ServiceBusyException( SR.GetString( SR.ClientAPIServiceBusy ) ) ); case (int)EventCode.E_ICARD_POLICY: throw IDT.ThrowHelperError( new PolicyValidationException( SR.GetString( SR.ClientAPIInvalidPolicy ) ) ); case (int)EventCode.E_ICARD_UNSUPPORTED: throw IDT.ThrowHelperError( new UnsupportedPolicyOptionsException( SR.GetString( SR.ClientAPIUnsupportedPolicyOptions ) ) ); case ( int ) EventCode.E_ICARD_UI_INITIALIZATION: throw IDT.ThrowHelperError( new UIInitializationException( SR.GetString( SR.ClientAPIUIInitializationFailed ) ) ); case ( int ) EventCode.E_ICARD_IMPORT: throw IDT.ThrowHelperError( new CardSpaceException( SR.GetString( SR.ClientAPICannotImport ) ) ); default: // // In current implementation, caller will determine what to do in the default case. // ; break; } } } // // Summary // Generic Infocard Exception class used to indicate failures in teh Infocard system // [Serializable] public class CardSpaceException : System.Exception { public CardSpaceException() : base() { } public CardSpaceException( string message ) : base( message ) { } public CardSpaceException( string message, Exception innerException ) : base( message, innerException ) { } protected CardSpaceException( SerializationInfo info, StreamingContext context ) : base( info, context ) { } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Runtime.Serialization; using Microsoft.InfoCards.Diagnostics; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; using Microsoft.InfoCards; internal static class ExceptionHelper { public static void ThrowIfCardSpaceException( int status ) { switch( status ) { case (int)EventCode.E_ICARD_COMMUNICATION: throw IDT.ThrowHelperError( new CardSpaceException( SR.GetString( SR.ClientAPIInfocardError ) ) ); case (int)EventCode.E_ICARD_USERCANCELLED: throw IDT.ThrowHelperError( new UserCancellationException( SR.GetString( SR.ClientAPIUserCancellationError ) ) ); case (int)EventCode.E_ICARD_SERVICE: throw IDT.ThrowHelperError( new ServiceNotStartedException( SR.GetString( SR.ClientAPIServiceNotStartedError ) ) ); case (int)EventCode.E_ICARD_UNTRUSTED: throw IDT.ThrowHelperError( new UntrustedRecipientException( SR.GetString( SR.ClientAPIUntrustedRecipientError ) ) ); case (int)EventCode.E_ICARD_TRUSTEXCHANGE: throw IDT.ThrowHelperError( new StsCommunicationException( SR.GetString( SR.ClientStsCommunicationException ) ) ); case (int)EventCode.E_ICARD_IDENTITY: throw IDT.ThrowHelperError( new IdentityValidationException( SR.GetString( SR.ClientAPIInvalidIdentity ) ) ); case (int)EventCode.E_ICARD_SERVICEBUSY: throw IDT.ThrowHelperError( new ServiceBusyException( SR.GetString( SR.ClientAPIServiceBusy ) ) ); case (int)EventCode.E_ICARD_POLICY: throw IDT.ThrowHelperError( new PolicyValidationException( SR.GetString( SR.ClientAPIInvalidPolicy ) ) ); case (int)EventCode.E_ICARD_UNSUPPORTED: throw IDT.ThrowHelperError( new UnsupportedPolicyOptionsException( SR.GetString( SR.ClientAPIUnsupportedPolicyOptions ) ) ); case ( int ) EventCode.E_ICARD_UI_INITIALIZATION: throw IDT.ThrowHelperError( new UIInitializationException( SR.GetString( SR.ClientAPIUIInitializationFailed ) ) ); case ( int ) EventCode.E_ICARD_IMPORT: throw IDT.ThrowHelperError( new CardSpaceException( SR.GetString( SR.ClientAPICannotImport ) ) ); default: // // In current implementation, caller will determine what to do in the default case. // ; break; } } } // // Summary // Generic Infocard Exception class used to indicate failures in teh Infocard system // [Serializable] public class CardSpaceException : System.Exception { public CardSpaceException() : base() { } public CardSpaceException( string message ) : base( message ) { } public CardSpaceException( string message, Exception innerException ) : base( message, innerException ) { } protected CardSpaceException( SerializationInfo info, StreamingContext context ) : base( info, context ) { } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripGripRenderEventArgs.cs
- SkewTransform.cs
- WebScriptEnablingElement.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- GridViewSelectEventArgs.cs
- SamlAuthenticationStatement.cs
- IpcPort.cs
- BitmapSizeOptions.cs
- ComboBox.cs
- WindowsToolbarAsMenu.cs
- TextureBrush.cs
- DataGridViewRowPostPaintEventArgs.cs
- RelationshipSet.cs
- HostTimeoutsElement.cs
- HostingEnvironment.cs
- Int32AnimationUsingKeyFrames.cs
- BindingElement.cs
- PropertyToken.cs
- DesignRelationCollection.cs
- EntitySqlQueryState.cs
- EncoderParameters.cs
- COM2PropertyDescriptor.cs
- EntityTypeEmitter.cs
- SurrogateChar.cs
- XmlSchemaComplexContentExtension.cs
- TypeSystemHelpers.cs
- Win32.cs
- LineSegment.cs
- WebPartVerbCollection.cs
- WhileDesigner.xaml.cs
- ClientBuildManagerCallback.cs
- ListenerServiceInstallComponent.cs
- ActionNotSupportedException.cs
- DBSqlParserTableCollection.cs
- ImmComposition.cs
- SplayTreeNode.cs
- ping.cs
- PieceNameHelper.cs
- TextContainerChangeEventArgs.cs
- SqlConnectionHelper.cs
- WorkflowInstanceProvider.cs
- HMACMD5.cs
- ReadOnlyObservableCollection.cs
- ContractSearchPattern.cs
- ConfigurationLocationCollection.cs
- FixedSOMTable.cs
- DateTimePickerDesigner.cs
- DataTrigger.cs
- Hash.cs
- OledbConnectionStringbuilder.cs
- MobileControl.cs
- DecimalConstantAttribute.cs
- DbConnectionOptions.cs
- EdgeProfileValidation.cs
- ChildrenQuery.cs
- NavigationProperty.cs
- DataReaderContainer.cs
- autovalidator.cs
- HttpHandlersSection.cs
- CultureInfoConverter.cs
- PersonalizationEntry.cs
- SqlRowUpdatingEvent.cs
- DrawingVisualDrawingContext.cs
- DoubleCollectionConverter.cs
- CodeCommentStatement.cs
- UndoUnit.cs
- OracleCommandSet.cs
- DocumentSequence.cs
- ResourceDescriptionAttribute.cs
- ListParagraph.cs
- InvalidOperationException.cs
- XamlFilter.cs
- TransportOutputChannel.cs
- ItemCollection.cs
- ZoomPercentageConverter.cs
- TableLayoutSettingsTypeConverter.cs
- BitmapImage.cs
- _LocalDataStoreMgr.cs
- Utils.cs
- OwnerDrawPropertyBag.cs
- OneOf.cs
- PersonalizationAdministration.cs
- CatalogZoneAutoFormat.cs
- SqlDataSourceWizardForm.cs
- WmlTextBoxAdapter.cs
- HScrollProperties.cs
- BoundField.cs
- ByteFacetDescriptionElement.cs
- XmlExpressionDumper.cs
- MarkupWriter.cs
- HtmlWindowCollection.cs
- CacheOutputQuery.cs
- SapiAttributeParser.cs
- URIFormatException.cs
- UInt16Storage.cs
- SessionPageStatePersister.cs
- ForeignKeyConstraint.cs
- regiisutil.cs
- PageCatalogPartDesigner.cs
- QilReference.cs