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
- ExpressionHelper.cs
- Imaging.cs
- SqlXml.cs
- DataControlField.cs
- FlatButtonAppearance.cs
- EraserBehavior.cs
- PropertyCollection.cs
- TrustSection.cs
- _ProxyChain.cs
- autovalidator.cs
- CellConstantDomain.cs
- SrgsElementList.cs
- LOSFormatter.cs
- ParameterCollectionEditor.cs
- TransformedBitmap.cs
- Pkcs9Attribute.cs
- WindowsFormsSectionHandler.cs
- InProcStateClientManager.cs
- X509SecurityTokenProvider.cs
- StateRuntime.cs
- DataControlFieldCollection.cs
- SendSecurityHeader.cs
- SqlNamer.cs
- Registry.cs
- LocalsItemDescription.cs
- MULTI_QI.cs
- ModelItemExtensions.cs
- WebPartDescriptionCollection.cs
- TiffBitmapEncoder.cs
- NetTcpBindingElement.cs
- Utility.cs
- ModuleConfigurationInfo.cs
- ClearTypeHintValidation.cs
- RenderingEventArgs.cs
- Viewport3DAutomationPeer.cs
- ResourceSet.cs
- ScrollBar.cs
- ChangeConflicts.cs
- ToggleButton.cs
- ObjectTag.cs
- DataReceivedEventArgs.cs
- ColumnHeaderConverter.cs
- ClientSideQueueItem.cs
- SamlConditions.cs
- IsolatedStoragePermission.cs
- FlowPosition.cs
- RestClientProxyHandler.cs
- Predicate.cs
- TableStyle.cs
- NonBatchDirectoryCompiler.cs
- AsyncCodeActivityContext.cs
- CodeTypeParameter.cs
- BinaryMessageEncodingBindingElement.cs
- HttpResponseInternalWrapper.cs
- ServiceModelEnumValidatorAttribute.cs
- RegexMatchCollection.cs
- _HeaderInfoTable.cs
- BitArray.cs
- ControlDesignerState.cs
- RequestCache.cs
- TransferRequestHandler.cs
- TemplateKey.cs
- SqlUserDefinedTypeAttribute.cs
- PrimitiveType.cs
- SqlConnection.cs
- ExtensionFile.cs
- CheckedListBox.cs
- IdnMapping.cs
- SiteMapPath.cs
- ICspAsymmetricAlgorithm.cs
- ListViewItemEventArgs.cs
- BindingBase.cs
- RegexStringValidator.cs
- RegisteredArrayDeclaration.cs
- FormsIdentity.cs
- FontWeight.cs
- DoubleAnimationUsingPath.cs
- SqlVersion.cs
- StructuredProperty.cs
- PropertyAccessVisitor.cs
- FolderBrowserDialog.cs
- DuplicateWaitObjectException.cs
- EmbeddedMailObject.cs
- ListenerServiceInstallComponent.cs
- ProfilePropertyNameValidator.cs
- SortDescription.cs
- SchemaElementDecl.cs
- BitmapScalingModeValidation.cs
- HwndProxyElementProvider.cs
- DataGridViewRowStateChangedEventArgs.cs
- TreeViewDesigner.cs
- SmtpMail.cs
- OptionUsage.cs
- OrderedParallelQuery.cs
- RawTextInputReport.cs
- ProjectionCamera.cs
- CodeAssignStatement.cs
- ZipIORawDataFileBlock.cs
- XmlSerializerAssemblyAttribute.cs
- KnownTypes.cs