Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / LessThanOrEqual.cs / 1305376 / LessThanOrEqual.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; public sealed class LessThanOrEqual: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given LessThanOrEqual 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.LessThanOrEqual, 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
- LabelTarget.cs
- PeerDefaultCustomResolverClient.cs
- Vector3D.cs
- PrtCap_Builder.cs
- CodeGenHelper.cs
- HotCommands.cs
- RequestQueryProcessor.cs
- PageThemeCodeDomTreeGenerator.cs
- ScalarConstant.cs
- SetterBase.cs
- TypedColumnHandler.cs
- BitmapEncoder.cs
- ManagedFilter.cs
- Properties.cs
- LiteralControl.cs
- GeneralTransform3DGroup.cs
- PictureBox.cs
- DesignerProperties.cs
- XPathNavigatorReader.cs
- Size.cs
- StoreConnection.cs
- HttpConfigurationSystem.cs
- ReliableRequestSessionChannel.cs
- LiteralControl.cs
- BoundColumn.cs
- XmlSchemaType.cs
- RevocationPoint.cs
- WebBrowserBase.cs
- StrongName.cs
- InternalBufferOverflowException.cs
- DataException.cs
- DesignerAdRotatorAdapter.cs
- WorkflowOperationInvoker.cs
- KeySplineConverter.cs
- MouseWheelEventArgs.cs
- ReadContentAsBinaryHelper.cs
- PenContexts.cs
- HtmlElementEventArgs.cs
- DoubleAnimationUsingPath.cs
- IxmlLineInfo.cs
- Frame.cs
- UpdateManifestForBrowserApplication.cs
- Duration.cs
- IPGlobalProperties.cs
- XmlUnspecifiedAttribute.cs
- CssTextWriter.cs
- DoubleAnimationUsingPath.cs
- XamlFxTrace.cs
- SkipQueryOptionExpression.cs
- KoreanCalendar.cs
- TreeView.cs
- ListViewGroupItemCollection.cs
- SchemaInfo.cs
- ResourcesChangeInfo.cs
- ProtectedConfigurationProviderCollection.cs
- EntitySetBaseCollection.cs
- ServiceAppDomainAssociationProvider.cs
- RegexWriter.cs
- CaseCqlBlock.cs
- ThemeConfigurationDialog.cs
- XmlIlGenerator.cs
- MimeMultiPart.cs
- FlowSwitchLink.cs
- SelectionRange.cs
- IgnoreFlushAndCloseStream.cs
- ValueConversionAttribute.cs
- AnonymousIdentificationModule.cs
- WebAdminConfigurationHelper.cs
- SecurityManager.cs
- TypeToTreeConverter.cs
- Debug.cs
- CqlLexer.cs
- ScopelessEnumAttribute.cs
- X509SubjectKeyIdentifierClause.cs
- Transform3DGroup.cs
- ConsoleCancelEventArgs.cs
- MetadataArtifactLoaderComposite.cs
- CreationContext.cs
- Converter.cs
- DataObjectEventArgs.cs
- CacheRequest.cs
- SslStream.cs
- DataGridViewBand.cs
- ValidationHelper.cs
- DataRow.cs
- TypeGeneratedEventArgs.cs
- _ListenerRequestStream.cs
- ObjectItemCachedAssemblyLoader.cs
- SmiSettersStream.cs
- MessageDescription.cs
- _FtpDataStream.cs
- CodeSubDirectoriesCollection.cs
- PropertyToken.cs
- BindingCompleteEventArgs.cs
- Transform.cs
- DecoderNLS.cs
- DesignerOptionService.cs
- GenericXmlSecurityToken.cs
- BuildProviderAppliesToAttribute.cs
- HitTestParameters3D.cs