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
- MarkupCompilePass1.cs
- XmlHelper.cs
- RegularExpressionValidator.cs
- XmlNotation.cs
- CompositeActivityDesigner.cs
- ActiveDesignSurfaceEvent.cs
- SamlDoNotCacheCondition.cs
- PhonemeConverter.cs
- NamedPipeTransportManager.cs
- ApplicationDirectory.cs
- TreeView.cs
- ValuePatternIdentifiers.cs
- SqlBulkCopyColumnMapping.cs
- mediapermission.cs
- PointAnimationBase.cs
- DmlSqlGenerator.cs
- QilName.cs
- XPathDocument.cs
- InkCanvasSelectionAdorner.cs
- ValidatingReaderNodeData.cs
- BindingExpressionUncommonField.cs
- SettingsPropertyIsReadOnlyException.cs
- MULTI_QI.cs
- Type.cs
- SoapTypeAttribute.cs
- SocketAddress.cs
- HTTPRemotingHandler.cs
- Int64AnimationBase.cs
- XmlEncodedRawTextWriter.cs
- AutoResetEvent.cs
- VirtualDirectoryMappingCollection.cs
- ListMarkerLine.cs
- GlyphRunDrawing.cs
- CallbackValidator.cs
- TCPListener.cs
- ItemCheckedEvent.cs
- CanonicalFontFamilyReference.cs
- PieceDirectory.cs
- DataBoundLiteralControl.cs
- WebHttpSecurity.cs
- EdmComplexPropertyAttribute.cs
- FontFamilyValueSerializer.cs
- ActivationProxy.cs
- AutomationPatternInfo.cs
- DecoderNLS.cs
- AssemblyBuilder.cs
- WebRequestModuleElementCollection.cs
- TableLayoutPanel.cs
- Msec.cs
- SAPIEngineTypes.cs
- WindowsUpDown.cs
- mongolianshape.cs
- WebAdminConfigurationHelper.cs
- HtmlLinkAdapter.cs
- DataGridTextBox.cs
- SamlAction.cs
- PipelineComponent.cs
- SQLByte.cs
- HandlerBase.cs
- HtmlInputPassword.cs
- AuthenticationModuleElement.cs
- VectorAnimation.cs
- MatrixValueSerializer.cs
- NativeMethods.cs
- SkinIDTypeConverter.cs
- ServiceBusyException.cs
- HttpWriter.cs
- ObjectQuery_EntitySqlExtensions.cs
- ItemContainerGenerator.cs
- RegistryKey.cs
- mediaeventargs.cs
- PartManifestEntry.cs
- AutoGeneratedField.cs
- OrthographicCamera.cs
- HttpEncoderUtility.cs
- WCFBuildProvider.cs
- TripleDESCryptoServiceProvider.cs
- _ScatterGatherBuffers.cs
- XmlTextReaderImpl.cs
- EmbeddedObject.cs
- SystemUnicastIPAddressInformation.cs
- Codec.cs
- SizeAnimation.cs
- LineServices.cs
- log.cs
- AnnotationObservableCollection.cs
- WinFormsSpinner.cs
- ButtonPopupAdapter.cs
- Size3D.cs
- WebHttpDispatchOperationSelectorData.cs
- StringAnimationBase.cs
- AsyncResult.cs
- HttpModuleAction.cs
- MessageQueueTransaction.cs
- WmlTextBoxAdapter.cs
- UpDownBase.cs
- ConsoleTraceListener.cs
- DBSchemaTable.cs
- WebBrowserEvent.cs
- SafeArrayTypeMismatchException.cs