Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / GreaterThanOrEqual.cs / 1305376 / GreaterThanOrEqual.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 GreaterThanOrEqual: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given GreaterThanOrEqual 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.GreaterThanOrEqual, 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
- FlatButtonAppearance.cs
- DataServiceHostWrapper.cs
- WSDualHttpBinding.cs
- RowToParametersTransformer.cs
- CollectionTypeElement.cs
- SimpleHandlerFactory.cs
- BackoffTimeoutHelper.cs
- RequestContext.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- _IPv6Address.cs
- IndentTextWriter.cs
- SqlProcedureAttribute.cs
- ListViewInsertedEventArgs.cs
- Vector3DCollection.cs
- Rijndael.cs
- ListBindableAttribute.cs
- WebDisplayNameAttribute.cs
- Atom10FormatterFactory.cs
- TdsParserStaticMethods.cs
- LocationUpdates.cs
- DataGridColumnsPage.cs
- ExpressionBinding.cs
- XmlSchemaSimpleContent.cs
- DispatcherTimer.cs
- SafeUserTokenHandle.cs
- AssemblyName.cs
- IndentedWriter.cs
- NumericPagerField.cs
- StateFinalizationActivity.cs
- WindowsRebar.cs
- MouseActionValueSerializer.cs
- ListViewDeleteEventArgs.cs
- LayoutTableCell.cs
- LinqDataSource.cs
- ApplicationActivator.cs
- ITextView.cs
- DynamicDataResources.Designer.cs
- ValueSerializer.cs
- RowVisual.cs
- ExpandedWrapper.cs
- CallSite.cs
- Security.cs
- ObjectManager.cs
- ToolStripRenderer.cs
- BaseAsyncResult.cs
- LayoutUtils.cs
- AppDomainAttributes.cs
- StrongNameUtility.cs
- RtfToXamlReader.cs
- UserControlAutomationPeer.cs
- DictionaryBase.cs
- LayoutEditorPart.cs
- EntityContainerAssociationSetEnd.cs
- ListDictionary.cs
- VisualStyleInformation.cs
- ExpressionVisitor.cs
- PathFigureCollection.cs
- WindowsSlider.cs
- VariableElement.cs
- FormViewPagerRow.cs
- OracleDataAdapter.cs
- FullTrustAssembliesSection.cs
- ConfigurationManagerHelper.cs
- DataSetMappper.cs
- TypeForwardedToAttribute.cs
- TitleStyle.cs
- HitTestDrawingContextWalker.cs
- ByteStack.cs
- X509CertificateCollection.cs
- SoapExtensionStream.cs
- CngProperty.cs
- OrderedDictionaryStateHelper.cs
- Utils.cs
- TemplateAction.cs
- XPathBinder.cs
- SafeProcessHandle.cs
- RectKeyFrameCollection.cs
- SqlDataSource.cs
- DecoderReplacementFallback.cs
- Transform.cs
- SamlAuthenticationClaimResource.cs
- AlternateViewCollection.cs
- DynamicArgumentDialog.cs
- HandlerBase.cs
- UnicastIPAddressInformationCollection.cs
- ImportContext.cs
- AuthStoreRoleProvider.cs
- ExecutedRoutedEventArgs.cs
- Compensate.cs
- ThicknessConverter.cs
- SqlComparer.cs
- XmlDataSource.cs
- CodeNamespace.cs
- OleTxTransactionInfo.cs
- XamlWriter.cs
- PersonalizationProviderHelper.cs
- Pkcs7Recipient.cs
- XmlQualifiedNameTest.cs
- TextTrailingWordEllipsis.cs
- ImageSourceConverter.cs