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
- FSWPathEditor.cs
- MetadataUtil.cs
- NamedPipeTransportManager.cs
- SspiNegotiationTokenProvider.cs
- TextServicesProperty.cs
- Viewport3DAutomationPeer.cs
- NumberFormatInfo.cs
- DBSchemaTable.cs
- ProvideValueServiceProvider.cs
- PrimitiveDataContract.cs
- AesCryptoServiceProvider.cs
- ScrollPattern.cs
- TabControlAutomationPeer.cs
- WebPartConnection.cs
- PathFigure.cs
- ObservableCollection.cs
- BamlBinaryWriter.cs
- ConsumerConnectionPoint.cs
- IsolatedStoragePermission.cs
- SqlEnums.cs
- TargetPerspective.cs
- ContextProperty.cs
- FileStream.cs
- IMembershipProvider.cs
- XNameConverter.cs
- XmlIlVisitor.cs
- ComponentChangingEvent.cs
- WebMessageFormatHelper.cs
- UrlAuthorizationModule.cs
- SoapSchemaMember.cs
- TextControl.cs
- XmlArrayItemAttributes.cs
- WebPartConnectionsConfigureVerb.cs
- MappingSource.cs
- WorkflowTransactionOptions.cs
- JoinGraph.cs
- CreateUserErrorEventArgs.cs
- EndpointFilterProvider.cs
- PersonalizationDictionary.cs
- StatusBar.cs
- SQLBoolean.cs
- MetadataPropertyCollection.cs
- GroupDescription.cs
- EntityContainerAssociationSet.cs
- SQLSingle.cs
- MemberProjectionIndex.cs
- Soap11ServerProtocol.cs
- PreviewPrintController.cs
- ManualResetEventSlim.cs
- TransportConfigurationTypeElement.cs
- FederatedMessageSecurityOverHttpElement.cs
- EventManager.cs
- SortedList.cs
- ContractListAdapter.cs
- X509ChainElement.cs
- ExpressionCopier.cs
- RecordConverter.cs
- GPRECT.cs
- CacheOutputQuery.cs
- UdpTransportBindingElement.cs
- SQLDoubleStorage.cs
- LineProperties.cs
- ServiceNameElement.cs
- Page.cs
- ErrorEventArgs.cs
- ToolboxComponentsCreatingEventArgs.cs
- TreeBuilder.cs
- ConstructorBuilder.cs
- DescriptionAttribute.cs
- PeerNodeAddress.cs
- MsmqHostedTransportConfiguration.cs
- StylusPointProperty.cs
- odbcmetadatacollectionnames.cs
- manifestimages.cs
- WCFBuildProvider.cs
- PriorityBinding.cs
- KeyboardEventArgs.cs
- IISMapPath.cs
- PointAnimationClockResource.cs
- EncryptedType.cs
- FrugalList.cs
- EncryptedKeyIdentifierClause.cs
- StringOutput.cs
- XmlBinaryReader.cs
- RequestCacheValidator.cs
- TextTreeNode.cs
- EventLogInformation.cs
- CalendarTable.cs
- OpCodes.cs
- xmlsaver.cs
- KoreanCalendar.cs
- Array.cs
- RandomDelaySendsAsyncResult.cs
- VideoDrawing.cs
- SizeValueSerializer.cs
- ObjectStorage.cs
- ACL.cs
- AdvancedBindingPropertyDescriptor.cs
- XPathNode.cs
- METAHEADER.cs