Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / And.cs / 1305376 / And.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Expressions { using System.Activities; using System.Activities.Statements; using System.Linq.Expressions; using System.Activities.Validation; using System.Collections.Generic; using System.ComponentModel; using System.Runtime; using System.Diagnostics.CodeAnalysis; [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldNotMatchKeywords, Justification = "Optimizing for XAML naming. VB imperative users will [] qualify (e.g. New [And])")] public sealed class And: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given And are the same. //It's possible that 2 threads are assigning the operationFucntion at the same time. But it's okay because the compiled codes are the same. static Func operationFunction; [RequiredArgument] [DefaultValue(null)] public InArgument Left { get; set; } [RequiredArgument] [DefaultValue(null)] public InArgument Right { get; set; } protected override void CacheMetadata(CodeActivityMetadata metadata) { BinaryExpressionHelper.OnGetArguments(metadata, this.Left, this.Right); if (operationFunction == null) { ValidationError validationError; if (!BinaryExpressionHelper.TryGenerateLinqDelegate(ExpressionType.And, out operationFunction, out validationError)) { metadata.AddValidationError(validationError); } } } protected override TResult Execute(CodeActivityContext context) { Fx.Assert(operationFunction != null, "OperationFunction must exist."); TLeft leftValue = this.Left.Get(context); TRight rightValue = this.Right.Get(context); return operationFunction(leftValue, rightValue); } } } // 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
- EntityDataSourceContextCreatingEventArgs.cs
- LogicalExpr.cs
- ToolStripTextBox.cs
- DataGridViewSelectedRowCollection.cs
- WebDescriptionAttribute.cs
- JsonQueryStringConverter.cs
- SendActivityDesigner.cs
- ErrorFormatter.cs
- DataControlFieldHeaderCell.cs
- TextRunCacheImp.cs
- TextMarkerSource.cs
- XmlSchemaException.cs
- ListViewTableRow.cs
- SoapAttributes.cs
- AssemblyBuilder.cs
- StructureChangedEventArgs.cs
- Globals.cs
- XmlCountingReader.cs
- ArrayList.cs
- DataGridViewCellEventArgs.cs
- DataControlFieldCollection.cs
- BindingMAnagerBase.cs
- AssemblySettingAttributes.cs
- TreeNode.cs
- WebBrowserBase.cs
- PlatformCulture.cs
- XmlIterators.cs
- Facet.cs
- GridProviderWrapper.cs
- BigInt.cs
- DoubleStorage.cs
- ShaderEffect.cs
- MenuItemCollectionEditorDialog.cs
- MetadataCache.cs
- BasicExpandProvider.cs
- RegistrationServices.cs
- BinaryMessageEncoder.cs
- TreeIterators.cs
- DeviceContext2.cs
- ConfigurationManagerHelper.cs
- ValidatedControlConverter.cs
- CapabilitiesRule.cs
- DebugHandleTracker.cs
- HtmlTernaryTree.cs
- BigInt.cs
- MediaElementAutomationPeer.cs
- EndPoint.cs
- TransportConfigurationTypeElementCollection.cs
- ArrangedElement.cs
- ExpanderAutomationPeer.cs
- ScriptControlDescriptor.cs
- ToolStripPanelRow.cs
- HandlerBase.cs
- TypefaceMetricsCache.cs
- odbcmetadatafactory.cs
- XmlIlTypeHelper.cs
- HasCopySemanticsAttribute.cs
- SchemaCollectionCompiler.cs
- LoadedEvent.cs
- cryptoapiTransform.cs
- Identity.cs
- KeyInfo.cs
- DispatcherSynchronizationContext.cs
- BooleanKeyFrameCollection.cs
- DataBoundControlAdapter.cs
- smtpconnection.cs
- Span.cs
- LogicalExpressionEditor.cs
- Repeater.cs
- TextEditorContextMenu.cs
- GridViewColumn.cs
- ListViewItemMouseHoverEvent.cs
- BezierSegment.cs
- processwaithandle.cs
- OleDbConnection.cs
- Method.cs
- CodeDelegateCreateExpression.cs
- GenericAuthenticationEventArgs.cs
- Regex.cs
- Encoding.cs
- SystemUnicastIPAddressInformation.cs
- SmtpNetworkElement.cs
- DefaultAuthorizationContext.cs
- XmlNullResolver.cs
- AuthenticatingEventArgs.cs
- Solver.cs
- CodeChecksumPragma.cs
- SqlNodeAnnotation.cs
- HMACSHA256.cs
- DependentTransaction.cs
- RegexParser.cs
- StorageConditionPropertyMapping.cs
- ImplicitInputBrush.cs
- _UncName.cs
- CodeEntryPointMethod.cs
- NavigationPropertyEmitter.cs
- CodeAttributeArgument.cs
- ScriptReferenceBase.cs
- FrameworkContextData.cs
- EntityFunctions.cs