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
- CollectionBase.cs
- ListDictionary.cs
- NativeCppClassAttribute.cs
- OdbcDataAdapter.cs
- TypeToken.cs
- AdjustableArrowCap.cs
- COM2PropertyPageUITypeConverter.cs
- TextBoxAutomationPeer.cs
- RecordBuilder.cs
- HitTestFilterBehavior.cs
- OleDbRowUpdatingEvent.cs
- ElementNotAvailableException.cs
- DoubleAnimationBase.cs
- StreamWithDictionary.cs
- _DisconnectOverlappedAsyncResult.cs
- RegexStringValidator.cs
- xamlnodes.cs
- HttpInputStream.cs
- ClientRuntimeConfig.cs
- HelpEvent.cs
- ColorPalette.cs
- MinMaxParagraphWidth.cs
- HtmlEmptyTagControlBuilder.cs
- OleDbFactory.cs
- InkCanvasFeedbackAdorner.cs
- EnumMember.cs
- ClickablePoint.cs
- EntityParameterCollection.cs
- DescendantOverDescendantQuery.cs
- ProviderConnectionPointCollection.cs
- ReferenceSchema.cs
- DynamicValidatorEventArgs.cs
- Attributes.cs
- MatrixAnimationUsingKeyFrames.cs
- UnmanagedMemoryStream.cs
- Region.cs
- SecurityContext.cs
- WebServiceEnumData.cs
- ProviderUtil.cs
- LocalizabilityAttribute.cs
- LingerOption.cs
- LogicalExpr.cs
- DataGridBoolColumn.cs
- PointCollection.cs
- MenuItemAutomationPeer.cs
- ProviderCommandInfoUtils.cs
- SecureUICommand.cs
- EventLogPermissionEntryCollection.cs
- Switch.cs
- EmptyEnumerator.cs
- XmlHierarchicalDataSourceView.cs
- Transactions.cs
- _ProxyChain.cs
- Logging.cs
- ObjectDataSourceMethodEventArgs.cs
- BufferModeSettings.cs
- BackStopAuthenticationModule.cs
- NoneExcludedImageIndexConverter.cs
- ExtensionDataReader.cs
- Int64.cs
- Processor.cs
- TableSectionStyle.cs
- SubMenuStyle.cs
- WebControlParameterProxy.cs
- DataColumnChangeEvent.cs
- MLangCodePageEncoding.cs
- WebPartHelpVerb.cs
- AudioStateChangedEventArgs.cs
- OledbConnectionStringbuilder.cs
- ParameterBuilder.cs
- PeerNearMe.cs
- TransportContext.cs
- FlowDocumentPageViewerAutomationPeer.cs
- Adorner.cs
- GridViewPageEventArgs.cs
- DocumentOrderQuery.cs
- CultureData.cs
- FormatterConverter.cs
- DataGridViewCellPaintingEventArgs.cs
- SerializationStore.cs
- UpdateManifestForBrowserApplication.cs
- UnlockInstanceCommand.cs
- PageContentCollection.cs
- SplayTreeNode.cs
- ObjectDataSourceChooseMethodsPanel.cs
- IisTraceWebEventProvider.cs
- ParserHooks.cs
- PackageRelationshipSelector.cs
- GridViewUpdatedEventArgs.cs
- Stylesheet.cs
- webeventbuffer.cs
- EntityConnection.cs
- AttachedPropertyMethodSelector.cs
- DataServices.cs
- DataSvcMapFileSerializer.cs
- Misc.cs
- DrawingImage.cs
- NumberFormatter.cs
- CellTreeNode.cs
- NativeMethods.cs