Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / AppliesToBehaviorDecisionTable.cs / 1 / AppliesToBehaviorDecisionTable.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // // Presharp uses the c# pragma mechanism to supress its warnings. // These are not recognised by the base compiler so we need to explictly // disable the following warnings. See http://winweb/cse/Tools/PREsharp/userguide/default.asp // for details. // namespace Microsoft.InfoCards { using System; using System.Collections; internal enum AppliesToBehaviorDecision :byte { DoNotSend = 0, SendRPAppliesTo = 1, SendCustomAppliesTo = 2, FailMatch = 3 }; // // This class is used to store the decision table that decides if an AppliesTo element // is being sent in an RST to the IPSTS // internal static class AppliesToBehaviorDecisionTable { static AppliesToBehaviorDecision[ , ] appliesToDecisionTable = new AppliesToBehaviorDecision[ 2, 3 ]; static AppliesToBehaviorDecisionTable() { // The table is populated as follows // // Case AppliesTo RequireAppliesTo Result Scenario // in Policy in crd // 1 Yes Required RP AppliesTo sent to IP Auditing STS // 2 No Required Cardspace manufactured Auditing STS // AppliesTo set to IP // 3 Yes Not present Fail ( done during card - // matching ) // 4 No Not present No AppliesTo sent to IP Non-auditing IP/STS OR dedicated IP/STS // 5 Yes Optional RP AppliesTo sent to IP Using Driver�s License managed card on DOL site // 6 No Optional No AppliesTo sent to IP Scenario: Shopping at www.wine.com and need DOL IP/STS to prove age > 21 appliesToDecisionTable[ 0, (int)RequireAppliesToStatus.NotPresent ] = AppliesToBehaviorDecision.DoNotSend; appliesToDecisionTable[ 1, (int)RequireAppliesToStatus.NotPresent ] = AppliesToBehaviorDecision.FailMatch; appliesToDecisionTable[ 0, (int)RequireAppliesToStatus.Optional ] = AppliesToBehaviorDecision.DoNotSend; appliesToDecisionTable[ 1, (int)RequireAppliesToStatus.Optional ] = AppliesToBehaviorDecision.SendRPAppliesTo; appliesToDecisionTable[ 0, (int)RequireAppliesToStatus.Required ] = AppliesToBehaviorDecision.SendCustomAppliesTo; appliesToDecisionTable[ 1, (int)RequireAppliesToStatus.Required ] = AppliesToBehaviorDecision.SendRPAppliesTo; } // // Summary: // Finds out if AppliesTo will be sent in the RST and in what format // // Parameters: // policy - Pointer to the incoming policy. // requireAppliesTo - The requireAppliesTo value on the card // considerUnrecognizedElements - Specifies whether to treat the existence of unrecognized elements in policy // as the same as having an AppliesTo element specified. This is done for privacy purposes. // // Returns the expected behavior of AppliesTo in the RST // private static AppliesToBehaviorDecision GetAppliesToBehaviorDecision( InfoCardPolicy policy, RequireAppliesToStatus requireAppliesTo, bool considerUnrecognizedElements ) { int policyHasAppliesTo = null == policy.PolicyAppliesTo ? 0 : 1; if( considerUnrecognizedElements ) { // // having unknown elements is equivalent to having applies to in policy. // See "CSD Dev Framework' bug 9248. // /* SSS_WARNINGS_OFF */ policyHasAppliesTo = policy.NonWhiteListElementsFound ? 1 : policyHasAppliesTo; /* SSS_WARNINGS_ON */ } return appliesToDecisionTable[ policyHasAppliesTo, (int)requireAppliesTo ]; } // // Summary: // Finds out if AppliesTo will be sent in the RST and in what format // // Parameters: // policy - Pointer to the incoming policy. // requireAppliesTo - The requireAppliesTo value on the card // // Returns the expected behavior of AppliesTo in the RST // public static AppliesToBehaviorDecision GetAppliesToBehaviorDecisionForRst( InfoCardPolicy policy, RequireAppliesToStatus requireAppliesTo ) { return GetAppliesToBehaviorDecision( policy, requireAppliesTo, false ); } // // Summary: // Finds out if AppliesTo will be sent in the RST and in what format // // Parameters: // policy - Pointer to the incoming policy. // requireAppliesTo - The requireAppliesTo value on the card // // Returns the expected behavior of AppliesTo in the RST // public static AppliesToBehaviorDecision GetAppliesToBehaviorDecisionForPolicyMatch( InfoCardPolicy policy, RequireAppliesToStatus requireAppliesTo ) { return GetAppliesToBehaviorDecision( policy, requireAppliesTo, true ); } } } // 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
- DBSqlParserColumn.cs
- ObjectDataSourceWizardForm.cs
- SpotLight.cs
- TCPClient.cs
- Reference.cs
- Throw.cs
- DotExpr.cs
- InstallHelper.cs
- ModifierKeysConverter.cs
- DrawListViewSubItemEventArgs.cs
- XmlNodeChangedEventManager.cs
- DeclaredTypeElement.cs
- Speller.cs
- PaintEvent.cs
- HttpStreamMessage.cs
- ColorMatrix.cs
- DbProviderSpecificTypePropertyAttribute.cs
- GenerateScriptTypeAttribute.cs
- PersistenceTypeAttribute.cs
- HWStack.cs
- PersonalizationProviderCollection.cs
- WebPartZoneBase.cs
- Message.cs
- WebResourceUtil.cs
- SubqueryTrackingVisitor.cs
- UrlPath.cs
- _HeaderInfo.cs
- CurrentTimeZone.cs
- Buffer.cs
- ListBox.cs
- WebGetAttribute.cs
- PageAsyncTask.cs
- GreenMethods.cs
- Property.cs
- PointAnimationClockResource.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- UnsafeNativeMethods.cs
- Dynamic.cs
- PeerApplicationLaunchInfo.cs
- ClientTargetCollection.cs
- Crypto.cs
- WindowHideOrCloseTracker.cs
- SubMenuStyleCollection.cs
- PopupRootAutomationPeer.cs
- ChangeTracker.cs
- NavigationWindow.cs
- VarInfo.cs
- AuthenticationSection.cs
- SspiHelper.cs
- GeneralTransform3DGroup.cs
- CriticalExceptions.cs
- ResetableIterator.cs
- ElementMarkupObject.cs
- Image.cs
- UnsafeNativeMethods.cs
- OLEDB_Enum.cs
- CustomErrorsSection.cs
- Rule.cs
- Int32EqualityComparer.cs
- DataGridItem.cs
- CollectionEditorDialog.cs
- String.cs
- Track.cs
- ProjectionCamera.cs
- PreviewPrintController.cs
- ForwardPositionQuery.cs
- basecomparevalidator.cs
- CodeGroup.cs
- PreProcessInputEventArgs.cs
- SocketAddress.cs
- FunctionMappingTranslator.cs
- MetadataSource.cs
- ConnectionPoolManager.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DocumentPageTextView.cs
- XmlAttributeAttribute.cs
- DateTimePicker.cs
- ContextStaticAttribute.cs
- PropertyEmitter.cs
- InputLanguageSource.cs
- SerializationInfo.cs
- DateTimeParse.cs
- XmlToDatasetMap.cs
- EmptyEnumerable.cs
- EntityAdapter.cs
- SerializationException.cs
- DesignerOptionService.cs
- FileEnumerator.cs
- Utilities.cs
- TypeInitializationException.cs
- SoundPlayerAction.cs
- QilCloneVisitor.cs
- VariableQuery.cs
- ResourceIDHelper.cs
- PrePostDescendentsWalker.cs
- ListParagraph.cs
- Annotation.cs
- HyperLinkField.cs
- SessionStateContainer.cs
- LayoutInformation.cs