Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / GreaterThan.cs / 1305376 / GreaterThan.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Expressions { using System.Activities; using System.Activities.Validation; using System.ComponentModel; using System.Linq.Expressions; using System.Runtime; public sealed class GreaterThan: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given GreaterThan 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.GreaterThan, 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
- FixedSOMImage.cs
- StyleBamlRecordReader.cs
- CapabilitiesAssignment.cs
- CodeCastExpression.cs
- DeploymentSection.cs
- MatrixTransform3D.cs
- ScriptServiceAttribute.cs
- httpstaticobjectscollection.cs
- ForeignKeyConstraint.cs
- BaseHashHelper.cs
- RepeaterItem.cs
- RowUpdatingEventArgs.cs
- XmlDocumentFragment.cs
- LockedBorderGlyph.cs
- PresentationAppDomainManager.cs
- OwnerDrawPropertyBag.cs
- PageAsyncTaskManager.cs
- SQLMoneyStorage.cs
- GPRECT.cs
- dataprotectionpermissionattribute.cs
- Control.cs
- StylusLogic.cs
- IProducerConsumerCollection.cs
- EntityKeyElement.cs
- CurrentChangingEventArgs.cs
- XmlQueryCardinality.cs
- SelectionPattern.cs
- TheQuery.cs
- GroupDescription.cs
- FormatConvertedBitmap.cs
- ForwardPositionQuery.cs
- StringFormat.cs
- XPathScanner.cs
- MessageBox.cs
- WorkflowDebuggerSteppingAttribute.cs
- BaseCodePageEncoding.cs
- NativeWindow.cs
- ISCIIEncoding.cs
- TreeViewImageIndexConverter.cs
- SettingsAttributeDictionary.cs
- StorageSetMapping.cs
- TableItemStyle.cs
- EtwProvider.cs
- SQLDateTimeStorage.cs
- LayoutTableCell.cs
- PeerCredentialElement.cs
- StylusLogic.cs
- SystemException.cs
- InputScope.cs
- StyleHelper.cs
- Triplet.cs
- InvalidPropValue.cs
- AutomationPatternInfo.cs
- Pts.cs
- HtmlInputPassword.cs
- ValueUtilsSmi.cs
- BufferModesCollection.cs
- UInt32Converter.cs
- SeekableReadStream.cs
- ExpressionConverter.cs
- Animatable.cs
- CodeDirectiveCollection.cs
- InstanceOwnerQueryResult.cs
- MultiTouchSystemGestureLogic.cs
- Win32PrintDialog.cs
- PropertyInfoSet.cs
- PairComparer.cs
- NavigationFailedEventArgs.cs
- UpdateRecord.cs
- FormatVersion.cs
- NativeWindow.cs
- CompModSwitches.cs
- XmlBinaryReader.cs
- FontUnit.cs
- PrintDialog.cs
- FixedSOMLineRanges.cs
- AutomationPropertyInfo.cs
- ClassHandlersStore.cs
- RouteItem.cs
- FieldNameLookup.cs
- SimpleWorkerRequest.cs
- Logging.cs
- ResourceDescriptionAttribute.cs
- LinqDataSourceInsertEventArgs.cs
- QueryPrefixOp.cs
- StringSource.cs
- _UriSyntax.cs
- PageStatePersister.cs
- MimeMapping.cs
- ObjectStateEntryDbDataRecord.cs
- ListItemConverter.cs
- PolyBezierSegment.cs
- CompositeScriptReference.cs
- _NativeSSPI.cs
- DeleteHelper.cs
- safex509handles.cs
- DbConnectionPoolIdentity.cs
- DataControlLinkButton.cs
- TraceUtility.cs
- TagElement.cs