Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / LessThan.cs / 1305376 / LessThan.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 LessThan: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given LessThan 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.LessThan, 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
- ClientRuntime.cs
- exports.cs
- TextServicesContext.cs
- EqualityComparer.cs
- Point3DKeyFrameCollection.cs
- SynchronousChannelMergeEnumerator.cs
- SafeEventLogWriteHandle.cs
- EntityTemplateUserControl.cs
- XmlNodeChangedEventManager.cs
- QilDataSource.cs
- SoapEnumAttribute.cs
- CommandLibraryHelper.cs
- ADConnectionHelper.cs
- StringHandle.cs
- HttpSessionStateWrapper.cs
- Int32CollectionConverter.cs
- XPathSelectionIterator.cs
- TextBoxRenderer.cs
- TextShapeableCharacters.cs
- Vector.cs
- IdleTimeoutMonitor.cs
- WindowsFormsHelpers.cs
- Avt.cs
- MbpInfo.cs
- BinHexEncoder.cs
- BaseTemplateBuildProvider.cs
- DecimalAnimationBase.cs
- X509SecurityToken.cs
- LogicalTreeHelper.cs
- SQLStringStorage.cs
- StringBlob.cs
- ListViewTableCell.cs
- FocusManager.cs
- Context.cs
- GatewayDefinition.cs
- TextureBrush.cs
- DataColumnMapping.cs
- WebConvert.cs
- MembershipPasswordException.cs
- RawStylusInputCustomDataList.cs
- WindowsFormsHostPropertyMap.cs
- LoginCancelEventArgs.cs
- RedirectionProxy.cs
- XamlReaderHelper.cs
- GenericWebPart.cs
- basevalidator.cs
- RewritingSimplifier.cs
- SplitterCancelEvent.cs
- XMLUtil.cs
- Variant.cs
- WebPartZoneCollection.cs
- XmlStringTable.cs
- MetadataException.cs
- ModifierKeysConverter.cs
- PassportIdentity.cs
- GridViewRow.cs
- CaseDesigner.xaml.cs
- ToolStripDropDownItem.cs
- RelationshipFixer.cs
- NameTable.cs
- QilGenerator.cs
- SecurityKeyIdentifier.cs
- OracleCommandSet.cs
- CodeBlockBuilder.cs
- ObjectViewListener.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- X509ServiceCertificateAuthentication.cs
- BufferedReceiveElement.cs
- ILGenerator.cs
- propertytag.cs
- DecimalConverter.cs
- PageParserFilter.cs
- RuleSettings.cs
- CaseStatementSlot.cs
- DesignerDataConnection.cs
- FontStyleConverter.cs
- XmlReflectionMember.cs
- XmlSerializationReader.cs
- LicenseProviderAttribute.cs
- TextElementEditingBehaviorAttribute.cs
- ResetableIterator.cs
- VerticalAlignConverter.cs
- SingleObjectCollection.cs
- XmlILTrace.cs
- EndPoint.cs
- ConnectionConsumerAttribute.cs
- HostedNamedPipeTransportManager.cs
- EntityDataSourceWrapperCollection.cs
- CookieParameter.cs
- CheckedPointers.cs
- ClipboardData.cs
- UpdatePanelTrigger.cs
- DataObjectAttribute.cs
- TextElement.cs
- ImpersonateTokenRef.cs
- ReaderWriterLockWrapper.cs
- AttributeTable.cs
- ButtonFlatAdapter.cs
- ProfileModule.cs
- GlyphTypeface.cs