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
- WebMessageFormatHelper.cs
- ThemeInfoAttribute.cs
- PropertyNames.cs
- XmlSerializationWriter.cs
- BrowserCapabilitiesFactory.cs
- PtsContext.cs
- FileDialogPermission.cs
- CalloutQueueItem.cs
- PEFileReader.cs
- LocalizeDesigner.cs
- PriorityQueue.cs
- FragmentQuery.cs
- ComponentSerializationService.cs
- Size3DValueSerializer.cs
- BamlRecordWriter.cs
- DataBoundControl.cs
- TableCell.cs
- TextBox.cs
- Table.cs
- Timer.cs
- ProjectedSlot.cs
- SafeEventHandle.cs
- ActivityExecutionContext.cs
- Tuple.cs
- ServiceModelActivationSectionGroup.cs
- DataGridViewTopLeftHeaderCell.cs
- EntityDataSourceConfigureObjectContext.cs
- AnnotationHelper.cs
- ArithmeticException.cs
- WebBrowserUriTypeConverter.cs
- RegexMatch.cs
- Pair.cs
- ValidationError.cs
- ListItemParagraph.cs
- CollectionViewGroupRoot.cs
- JsonObjectDataContract.cs
- ListChunk.cs
- ActivationServices.cs
- DynamicQueryStringParameter.cs
- MSAAWinEventWrap.cs
- ScrollPattern.cs
- _DigestClient.cs
- LogWriteRestartAreaState.cs
- AnimationClock.cs
- DateRangeEvent.cs
- SafeReversePInvokeHandle.cs
- RecordsAffectedEventArgs.cs
- ProfileSettings.cs
- RealProxy.cs
- TextTreeInsertUndoUnit.cs
- NonParentingControl.cs
- SqlProviderManifest.cs
- XmlNamespaceManager.cs
- StringSorter.cs
- StyleXamlParser.cs
- TransactionTraceIdentifier.cs
- MetafileHeader.cs
- remotingproxy.cs
- AssemblyAttributesGoHere.cs
- TrackingServices.cs
- OutputCacheProfile.cs
- TransformPattern.cs
- Memoizer.cs
- FormsAuthenticationCredentials.cs
- TitleStyle.cs
- HttpHandlerAction.cs
- XmlObjectSerializer.cs
- FormViewUpdateEventArgs.cs
- AssemblyInfo.cs
- CodeTypeReferenceExpression.cs
- AmbientLight.cs
- Int32Collection.cs
- XmlValueConverter.cs
- FileChangesMonitor.cs
- FixedSOMTableCell.cs
- QueryLifecycle.cs
- HandleRef.cs
- ErrorRuntimeConfig.cs
- UnsafeNativeMethods.cs
- PointCollectionValueSerializer.cs
- ParameterToken.cs
- IndividualDeviceConfig.cs
- FixedSOMFixedBlock.cs
- ExpressionBuilder.cs
- XmlSchemaComplexType.cs
- SQLDoubleStorage.cs
- EpmCustomContentSerializer.cs
- TransformerInfoCollection.cs
- PagesSection.cs
- TextBoxView.cs
- UshortList2.cs
- WebPartConnectVerb.cs
- TextBoxAutomationPeer.cs
- LambdaCompiler.Binary.cs
- ASCIIEncoding.cs
- XmlChildNodes.cs
- CompositionAdorner.cs
- __FastResourceComparer.cs
- TypeUtils.cs
- ProcessHostMapPath.cs