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
- EventBookmark.cs
- FileFormatException.cs
- ContainerParaClient.cs
- ObjectStateFormatter.cs
- IPeerNeighbor.cs
- FixedSchema.cs
- FilteredAttributeCollection.cs
- ButtonChrome.cs
- XpsS0ValidatingLoader.cs
- OdbcConnectionPoolProviderInfo.cs
- BitmapEffectInputConnector.cs
- ColumnMapProcessor.cs
- DataGridViewRowPrePaintEventArgs.cs
- DateTimeOffset.cs
- NetworkAddressChange.cs
- VisualStyleTypesAndProperties.cs
- StorageComplexPropertyMapping.cs
- StickyNote.cs
- IndexedString.cs
- PagerSettings.cs
- ByteStreamGeometryContext.cs
- BitHelper.cs
- ComponentEditorForm.cs
- KeyValueInternalCollection.cs
- HtmlElementErrorEventArgs.cs
- Internal.cs
- SHA1.cs
- SiteMapNode.cs
- XmlLangPropertyAttribute.cs
- Material.cs
- HelloMessage11.cs
- XhtmlTextWriter.cs
- DateTimeFormatInfoScanner.cs
- HtmlControlPersistable.cs
- IconBitmapDecoder.cs
- IInstanceTable.cs
- RedBlackList.cs
- PermissionSetEnumerator.cs
- AppearanceEditorPart.cs
- VsPropertyGrid.cs
- ProfileEventArgs.cs
- ControlCachePolicy.cs
- DetailsViewUpdatedEventArgs.cs
- ButtonBase.cs
- SqlMetaData.cs
- ValidationPropertyAttribute.cs
- EventHandlingScope.cs
- WindowsPrincipal.cs
- PenCursorManager.cs
- PersonalizationStateInfo.cs
- OutputCacheModule.cs
- PreviewPageInfo.cs
- SslStreamSecurityUpgradeProvider.cs
- DPCustomTypeDescriptor.cs
- RouteParser.cs
- TemplateControlParser.cs
- TextTreeText.cs
- ServiceDeploymentInfo.cs
- TimeoutTimer.cs
- Expression.cs
- OleServicesContext.cs
- SingleBodyParameterMessageFormatter.cs
- DropSourceBehavior.cs
- XPathSelectionIterator.cs
- SiteMapNodeCollection.cs
- TypeCacheManager.cs
- SQLInt32.cs
- SoapSchemaImporter.cs
- TimeSpanOrInfiniteValidator.cs
- DataConnectionHelper.cs
- TextFormatterContext.cs
- ByteRangeDownloader.cs
- RtfControls.cs
- DerivedKeySecurityTokenStub.cs
- SynchronousChannel.cs
- DataGridHeaderBorder.cs
- SoapReflectionImporter.cs
- CDSCollectionETWBCLProvider.cs
- PasswordTextNavigator.cs
- MemoryStream.cs
- ObjectReaderCompiler.cs
- AdjustableArrowCap.cs
- UpdateRecord.cs
- InsufficientExecutionStackException.cs
- TransactionWaitAsyncResult.cs
- ExpressionEditorAttribute.cs
- UnionExpr.cs
- DiagnosticsConfigurationHandler.cs
- PointCollectionConverter.cs
- _BasicClient.cs
- SafeNativeMethods.cs
- UserPreferenceChangingEventArgs.cs
- WebServiceBindingAttribute.cs
- _NetRes.cs
- AssociationSetMetadata.cs
- SimpleWorkerRequest.cs
- TextElementAutomationPeer.cs
- Parameter.cs
- MenuAdapter.cs
- PermissionListSet.cs