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
- BrowserDefinition.cs
- DataObject.cs
- FigureHelper.cs
- XmlCodeExporter.cs
- OptimisticConcurrencyException.cs
- ContextStack.cs
- FormatterConverter.cs
- OleDbCommandBuilder.cs
- DynamicValidatorEventArgs.cs
- TrackingServices.cs
- EntityParameter.cs
- RoleGroup.cs
- listviewsubitemcollectioneditor.cs
- TypedReference.cs
- TextAnchor.cs
- CombinedGeometry.cs
- CalendarAutoFormatDialog.cs
- XsdValidatingReader.cs
- ParameterEditorUserControl.cs
- NTAccount.cs
- CancellationHandler.cs
- ExecutionScope.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- TokenBasedSet.cs
- SoapTransportImporter.cs
- CodeEventReferenceExpression.cs
- SByteStorage.cs
- ColorConverter.cs
- TreeViewItem.cs
- MimeObjectFactory.cs
- RequestQueue.cs
- ConsoleEntryPoint.cs
- WindowsTab.cs
- ScriptBehaviorDescriptor.cs
- XComponentModel.cs
- AlternateView.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XPathNode.cs
- CqlBlock.cs
- precedingsibling.cs
- CommandValueSerializer.cs
- UnitySerializationHolder.cs
- Identifier.cs
- X509CertificateValidator.cs
- DefaultValueConverter.cs
- X509Certificate2Collection.cs
- URI.cs
- TimeoutTimer.cs
- GPPOINTF.cs
- PathTooLongException.cs
- FieldMetadata.cs
- WebPartDisplayModeCollection.cs
- EFDataModelProvider.cs
- SystemMulticastIPAddressInformation.cs
- JsonGlobals.cs
- SqlDataReader.cs
- SqlConnectionPoolGroupProviderInfo.cs
- NativeMethods.cs
- ListViewItem.cs
- ClientConfigPaths.cs
- PageSetupDialog.cs
- GroupStyle.cs
- Vector3DValueSerializer.cs
- FamilyTypefaceCollection.cs
- DataGridViewCellFormattingEventArgs.cs
- SqlMethodAttribute.cs
- WaitHandleCannotBeOpenedException.cs
- DoWorkEventArgs.cs
- PrimitiveSchema.cs
- CounterSampleCalculator.cs
- GeometryConverter.cs
- Debugger.cs
- PluralizationService.cs
- ToolStripRenderEventArgs.cs
- PathGeometry.cs
- WpfSharedXamlSchemaContext.cs
- PageBuildProvider.cs
- RC2CryptoServiceProvider.cs
- StylusEventArgs.cs
- ISFClipboardData.cs
- TdsParserStateObject.cs
- IdnMapping.cs
- ExpressionReplacer.cs
- HttpHandlersSection.cs
- WorkflowElementDialog.cs
- Control.cs
- Effect.cs
- HostedElements.cs
- PageRequestManager.cs
- IPAddress.cs
- Model3DCollection.cs
- CachedPathData.cs
- _StreamFramer.cs
- DocumentationServerProtocol.cs
- RequestDescription.cs
- ToolbarAUtomationPeer.cs
- XmlArrayAttribute.cs
- SerialPinChanges.cs
- WebRequestModuleElement.cs
- DefaultHttpHandler.cs