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
- DataGridHyperlinkColumn.cs
- PerformanceCounterManager.cs
- ServiceParser.cs
- ISAPIApplicationHost.cs
- UdpDiscoveryEndpoint.cs
- ContentOnlyMessage.cs
- ExtensionSimplifierMarkupObject.cs
- XmlAttributeOverrides.cs
- SqlConnectionPoolGroupProviderInfo.cs
- SettingsSavedEventArgs.cs
- MatrixTransform.cs
- ValidatorUtils.cs
- DataTemplateSelector.cs
- AudioDeviceOut.cs
- URLAttribute.cs
- LayoutTable.cs
- DBConnection.cs
- XmlSchemaObject.cs
- SmiTypedGetterSetter.cs
- XmlUtil.cs
- HttpConfigurationSystem.cs
- PointAnimationUsingPath.cs
- SqlUDTStorage.cs
- sitestring.cs
- XmlAttributes.cs
- SchemaImporter.cs
- CustomCategoryAttribute.cs
- ClientSession.cs
- TrimSurroundingWhitespaceAttribute.cs
- LogFlushAsyncResult.cs
- SemanticResolver.cs
- WbmpConverter.cs
- ContentDisposition.cs
- SqlIdentifier.cs
- Expression.cs
- Point4DConverter.cs
- COSERVERINFO.cs
- ISAPIRuntime.cs
- DictionaryKeyPropertyAttribute.cs
- Decoder.cs
- XmlKeywords.cs
- ItemDragEvent.cs
- oledbmetadatacollectionnames.cs
- RectangleConverter.cs
- NetSectionGroup.cs
- PersonalizationProviderHelper.cs
- ServiceBusyException.cs
- ListControlConvertEventArgs.cs
- UIElement.cs
- RootAction.cs
- StickyNoteAnnotations.cs
- OracleInfoMessageEventArgs.cs
- coordinatorfactory.cs
- _SingleItemRequestCache.cs
- TypedReference.cs
- StreamedFramingRequestChannel.cs
- XmlChildNodes.cs
- XPathExpr.cs
- ItemChangedEventArgs.cs
- httpserverutility.cs
- OneToOneMappingSerializer.cs
- DescendentsWalkerBase.cs
- oledbconnectionstring.cs
- BaseUriHelper.cs
- ISCIIEncoding.cs
- ConfigurationSettings.cs
- CLSCompliantAttribute.cs
- ProfessionalColorTable.cs
- XPathNavigator.cs
- xmlfixedPageInfo.cs
- FtpRequestCacheValidator.cs
- MatrixCamera.cs
- PresentationSource.cs
- ReferencedCollectionType.cs
- HMACSHA1.cs
- EditorZoneBase.cs
- Int32RectValueSerializer.cs
- HtmlImage.cs
- Stroke2.cs
- DataColumnCollection.cs
- TextContainerHelper.cs
- Evidence.cs
- CheckBoxField.cs
- ContainsRowNumberChecker.cs
- TextBoxBase.cs
- AssemblyNameUtility.cs
- listitem.cs
- FeedUtils.cs
- QilInvoke.cs
- ClrPerspective.cs
- TemplateBuilder.cs
- ObjectNavigationPropertyMapping.cs
- TextOnlyOutput.cs
- Geometry.cs
- EncodingDataItem.cs
- ContainerControl.cs
- ErrorProvider.cs
- OpenTypeLayoutCache.cs
- HandlerWithFactory.cs
- WindowsGraphicsCacheManager.cs