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
- WindowsListViewSubItem.cs
- SendKeys.cs
- TextBoxView.cs
- CaseInsensitiveOrdinalStringComparer.cs
- EventLogEntryCollection.cs
- WebBrowserHelper.cs
- PreservationFileReader.cs
- GPPOINT.cs
- MultiAsyncResult.cs
- DockPattern.cs
- ListItemCollection.cs
- RenderingEventArgs.cs
- _DynamicWinsockMethods.cs
- SourceFileBuildProvider.cs
- SiteMembershipCondition.cs
- WorkflowViewStateService.cs
- GPStream.cs
- LinqDataSourceView.cs
- PageParser.cs
- DataSourceHelper.cs
- CacheOutputQuery.cs
- GlobalizationSection.cs
- EventData.cs
- ToolStripPanel.cs
- RoutedEventHandlerInfo.cs
- SqlUDTStorage.cs
- IntegerValidator.cs
- AnimationTimeline.cs
- DeclarationUpdate.cs
- Error.cs
- Profiler.cs
- ProviderCollection.cs
- ClrProviderManifest.cs
- recordstatefactory.cs
- TreeBuilder.cs
- InheritanceContextHelper.cs
- DescendantQuery.cs
- CompModSwitches.cs
- PasswordTextContainer.cs
- Style.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- Base64Encoding.cs
- MetricEntry.cs
- ReferencedCollectionType.cs
- RenderContext.cs
- SqlXmlStorage.cs
- WebSysDescriptionAttribute.cs
- SecurityException.cs
- DataGridViewCellLinkedList.cs
- QueryStringParameter.cs
- WeakRefEnumerator.cs
- HTMLTagNameToTypeMapper.cs
- SecurityResources.cs
- DropShadowBitmapEffect.cs
- GeometryCollection.cs
- IdnMapping.cs
- XpsFilter.cs
- CompositeActivityMarkupSerializer.cs
- ByteKeyFrameCollection.cs
- DocumentAutomationPeer.cs
- GetWinFXPath.cs
- AnimationException.cs
- UserMapPath.cs
- DataContractSerializer.cs
- ServiceDescriptions.cs
- CompiledQuery.cs
- HostingEnvironment.cs
- XslVisitor.cs
- QilInvokeEarlyBound.cs
- VisualBasicSettings.cs
- DataGridTextBox.cs
- BitmapEncoder.cs
- MemberDescriptor.cs
- PageCanvasSize.cs
- SplineKeyFrames.cs
- NullReferenceException.cs
- FormViewUpdateEventArgs.cs
- ComAdminWrapper.cs
- SqlUserDefinedTypeAttribute.cs
- DbConnectionFactory.cs
- BrowsableAttribute.cs
- milexports.cs
- DataSourceControl.cs
- WebEvents.cs
- Compiler.cs
- ListView.cs
- PassportIdentity.cs
- ProtocolsSection.cs
- TransformerInfo.cs
- ConfigurationValidatorAttribute.cs
- RightsManagementPermission.cs
- ConvertTextFrag.cs
- ValidatingReaderNodeData.cs
- PeerPresenceInfo.cs
- CategoryGridEntry.cs
- SelectionChangedEventArgs.cs
- LayoutEvent.cs
- Logging.cs
- StringConverter.cs
- SafeProcessHandle.cs