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
- XmlCharacterData.cs
- RightsManagementEncryptedStream.cs
- ContainerParagraph.cs
- ToolStripItemGlyph.cs
- HighlightVisual.cs
- CancelEventArgs.cs
- TextBox.cs
- Ray3DHitTestResult.cs
- CultureTable.cs
- XmlWhitespace.cs
- WaitForChangedResult.cs
- ZipIOExtraFieldPaddingElement.cs
- activationcontext.cs
- PickBranch.cs
- HtmlTable.cs
- EventSchemaTraceListener.cs
- ArgumentNullException.cs
- XPathNode.cs
- BitStream.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- VariableBinder.cs
- LongValidatorAttribute.cs
- EnumMemberAttribute.cs
- XmlNodeReader.cs
- IndentTextWriter.cs
- CacheChildrenQuery.cs
- DependencySource.cs
- EmptyElement.cs
- WebBrowser.cs
- Directory.cs
- OleDbInfoMessageEvent.cs
- RestHandler.cs
- DataListItem.cs
- ExpressionPrefixAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- XmlSchemaComplexContentRestriction.cs
- ListViewPagedDataSource.cs
- SingleObjectCollection.cs
- MapPathBasedVirtualPathProvider.cs
- CellConstantDomain.cs
- ValidationErrorCollection.cs
- UnsignedPublishLicense.cs
- ContentElement.cs
- LineGeometry.cs
- LineProperties.cs
- EntityRecordInfo.cs
- SetterBaseCollection.cs
- ResourcePermissionBase.cs
- LocatorPartList.cs
- XmlSerializableReader.cs
- RecognizedWordUnit.cs
- NotCondition.cs
- ExternalFile.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- AutomationEventArgs.cs
- ZoneButton.cs
- Missing.cs
- HttpDictionary.cs
- PointHitTestParameters.cs
- _AuthenticationState.cs
- RegexParser.cs
- PropertyPathConverter.cs
- ArithmeticLiteral.cs
- DoubleLinkList.cs
- OrderByLifter.cs
- PassportPrincipal.cs
- TextRange.cs
- CodeTypeMember.cs
- TimeZone.cs
- UpdateTracker.cs
- SymbolMethod.cs
- CaseInsensitiveHashCodeProvider.cs
- ChtmlTextWriter.cs
- DetailsViewRowCollection.cs
- AutomationElementCollection.cs
- HostingPreferredMapPath.cs
- TiffBitmapDecoder.cs
- StrongNameKeyPair.cs
- MenuScrollingVisibilityConverter.cs
- WebPart.cs
- DataGridViewDataConnection.cs
- X509Utils.cs
- PageParserFilter.cs
- ObjRef.cs
- InkPresenterAutomationPeer.cs
- InfocardInteractiveChannelInitializer.cs
- ConstructorExpr.cs
- SelectionRangeConverter.cs
- Barrier.cs
- EncoderBestFitFallback.cs
- _ListenerAsyncResult.cs
- NullRuntimeConfig.cs
- RectValueSerializer.cs
- CqlLexerHelpers.cs
- DetailsViewDeletedEventArgs.cs
- COM2EnumConverter.cs
- DataGridViewDesigner.cs
- DrawingAttributes.cs
- ModuleBuilder.cs
- Button.cs