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
- CatalogPartChrome.cs
- TraceSource.cs
- ExpressionValueEditor.cs
- CounterSetInstance.cs
- MatrixCamera.cs
- FilterEventArgs.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- TreeNodeStyleCollection.cs
- DbConnectionClosed.cs
- CngProperty.cs
- EtwTrace.cs
- DataControlFieldCell.cs
- DataErrorValidationRule.cs
- ConstructorArgumentAttribute.cs
- ConfigurationPermission.cs
- AvTrace.cs
- InputLangChangeEvent.cs
- ExpressionBindingCollection.cs
- WebPartZoneBase.cs
- AutomationElement.cs
- OdbcEnvironmentHandle.cs
- StringExpressionSet.cs
- StringConcat.cs
- WindowsPrincipal.cs
- ExecutionEngineException.cs
- Variable.cs
- SqlColumnizer.cs
- XhtmlConformanceSection.cs
- UnionCqlBlock.cs
- StateWorkerRequest.cs
- RepeatBehaviorConverter.cs
- FileBasedResourceGroveler.cs
- WeakReferenceKey.cs
- AssociatedControlConverter.cs
- IgnoreFlushAndCloseStream.cs
- DetailsView.cs
- DropShadowEffect.cs
- CurrencyManager.cs
- InputManager.cs
- TextSearch.cs
- Constants.cs
- SliderAutomationPeer.cs
- ListViewTableRow.cs
- DynamicActivity.cs
- EdmProperty.cs
- SecurityUniqueId.cs
- FilterQuery.cs
- BaseProcessor.cs
- ListMarkerLine.cs
- TextRunCacheImp.cs
- StylusEventArgs.cs
- indexingfiltermarshaler.cs
- StrokeCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ContextMarshalException.cs
- ContextStaticAttribute.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- ObjectDataSourceEventArgs.cs
- ScriptReferenceEventArgs.cs
- SystemPens.cs
- ComboBox.cs
- RequestQueue.cs
- PointF.cs
- ObjectToken.cs
- TCPListener.cs
- Identifier.cs
- Permission.cs
- Int16Animation.cs
- HMACRIPEMD160.cs
- SqlProviderManifest.cs
- FormsAuthenticationUserCollection.cs
- HealthMonitoringSection.cs
- XamlBuildProvider.cs
- LoginUtil.cs
- AnimationLayer.cs
- _ListenerResponseStream.cs
- TabPage.cs
- BindableAttribute.cs
- PrintDialogException.cs
- _AutoWebProxyScriptHelper.cs
- SapiRecoContext.cs
- EntityDataSourceMemberPath.cs
- ListViewItemEventArgs.cs
- PenThreadWorker.cs
- Label.cs
- DrawingImage.cs
- AnimationStorage.cs
- ListViewDeletedEventArgs.cs
- TrueReadOnlyCollection.cs
- DataRelationCollection.cs
- KnownAssemblyEntry.cs
- ActivityContext.cs
- GeneralTransformCollection.cs
- SqlXmlStorage.cs
- InstalledFontCollection.cs
- _NegoState.cs
- Attachment.cs
- SQLInt64Storage.cs
- TableAdapterManagerNameHandler.cs
- BigInt.cs