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
- _FtpDataStream.cs
- XmlAttributeCache.cs
- StringKeyFrameCollection.cs
- WindowsGrip.cs
- CallContext.cs
- GenerateScriptTypeAttribute.cs
- AliasedSlot.cs
- SourceInterpreter.cs
- XmlAttribute.cs
- ChannelSinkStacks.cs
- DocumentSequenceHighlightLayer.cs
- _Events.cs
- FlowNode.cs
- DataGridViewSelectedRowCollection.cs
- GridView.cs
- BackEase.cs
- UpdatableGenericsFeature.cs
- MimeTypeMapper.cs
- SizeConverter.cs
- DecoderNLS.cs
- MenuStrip.cs
- WebEventCodes.cs
- ShapeTypeface.cs
- Frame.cs
- TreeBuilder.cs
- FrameworkContextData.cs
- FontDifferentiator.cs
- InternalResources.cs
- ExpressionNode.cs
- MSAAEventDispatcher.cs
- TypeConverter.cs
- ZipIOCentralDirectoryBlock.cs
- GeneralTransform3D.cs
- AmbientProperties.cs
- DataDocumentXPathNavigator.cs
- JsonStringDataContract.cs
- RadialGradientBrush.cs
- EntryPointNotFoundException.cs
- NumericPagerField.cs
- SpeechEvent.cs
- OverflowException.cs
- RIPEMD160.cs
- QilCloneVisitor.cs
- ValidationErrorCollection.cs
- CheckPair.cs
- EnumValAlphaComparer.cs
- RegexGroup.cs
- UrlEncodedParameterWriter.cs
- HtmlInputCheckBox.cs
- PrintDialog.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- DataMemberConverter.cs
- FlowDocumentPage.cs
- StrokeRenderer.cs
- ControlCachePolicy.cs
- URLEditor.cs
- SRDisplayNameAttribute.cs
- SourceFileBuildProvider.cs
- TextChangedEventArgs.cs
- PopOutPanel.cs
- PreservationFileReader.cs
- ListViewItem.cs
- FixedLineResult.cs
- IpcPort.cs
- SafeNativeMethods.cs
- Transform3D.cs
- HttpInputStream.cs
- ListBindingHelper.cs
- WindowsRegion.cs
- ContextMenu.cs
- PreProcessor.cs
- TagMapInfo.cs
- ExpandedWrapper.cs
- HyperLinkStyle.cs
- MaterializeFromAtom.cs
- WebEvents.cs
- DataObjectSettingDataEventArgs.cs
- PropertyDescriptorGridEntry.cs
- CounterCreationDataCollection.cs
- CustomDictionarySources.cs
- NavigationCommands.cs
- SQLConvert.cs
- FrameworkElement.cs
- DataControlField.cs
- PropertyToken.cs
- TreeNodeCollectionEditor.cs
- SelectorItemAutomationPeer.cs
- XmlEntity.cs
- XPathNodeInfoAtom.cs
- SemanticResultValue.cs
- MessageBuilder.cs
- EditingCommands.cs
- SystemColors.cs
- WindowProviderWrapper.cs
- BufferedGraphics.cs
- CornerRadiusConverter.cs
- processwaithandle.cs
- QilFactory.cs
- ConfigErrorGlyph.cs
- LineBreakRecord.cs