Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / NotEqual.cs / 1305376 / NotEqual.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 NotEqual: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given NotEqual 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.NotEqual, 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
- ViewStateModeByIdAttribute.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- CodeThrowExceptionStatement.cs
- Stackframe.cs
- DesignerCommandAdapter.cs
- Oci.cs
- ScrollBarAutomationPeer.cs
- RemoteX509AsymmetricSecurityKey.cs
- ExpressionsCollectionConverter.cs
- DispatcherHookEventArgs.cs
- ObjectDisposedException.cs
- SrgsItemList.cs
- OdbcParameterCollection.cs
- NullNotAllowedCollection.cs
- BmpBitmapDecoder.cs
- ElementAtQueryOperator.cs
- LayoutDump.cs
- FilterException.cs
- StrongName.cs
- ComEventsSink.cs
- NativeMethods.cs
- DurationConverter.cs
- DesignerView.xaml.cs
- PageWrapper.cs
- QilInvokeEarlyBound.cs
- AutomationElementCollection.cs
- ListSortDescription.cs
- CommandConverter.cs
- DataGridViewCellStyleConverter.cs
- DataStorage.cs
- PeerPresenceInfo.cs
- XPathNodePointer.cs
- DbConnectionOptions.cs
- FormsAuthenticationUserCollection.cs
- DataPointer.cs
- DateTimeConverter.cs
- Trace.cs
- VectorValueSerializer.cs
- Timer.cs
- HitTestParameters3D.cs
- DataKey.cs
- UserControlParser.cs
- Types.cs
- DBCSCodePageEncoding.cs
- AsyncResult.cs
- OutKeywords.cs
- SelectorAutomationPeer.cs
- ObjectCloneHelper.cs
- MessageTraceRecord.cs
- TableLayoutPanel.cs
- Descriptor.cs
- ObjectListComponentEditor.cs
- ObjectPersistData.cs
- _FixedSizeReader.cs
- SerializerWriterEventHandlers.cs
- TextElementCollection.cs
- RelationshipFixer.cs
- AccessDataSource.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SystemIPInterfaceStatistics.cs
- x509utils.cs
- AssemblyCollection.cs
- EntityDataSourceWrapper.cs
- WindowsListViewItemStartMenu.cs
- WebBrowserPermission.cs
- TextEmbeddedObject.cs
- AutomationPeer.cs
- DashStyle.cs
- DesignerForm.cs
- HttpListener.cs
- precedingquery.cs
- ServicePointManagerElement.cs
- FigureParaClient.cs
- HtmlTitle.cs
- JpegBitmapDecoder.cs
- CodeDirectiveCollection.cs
- ModelFunction.cs
- ContainerParagraph.cs
- Lasso.cs
- DataGridViewButtonCell.cs
- XPathPatternBuilder.cs
- RtfToXamlLexer.cs
- DoubleAnimationUsingPath.cs
- HtmlLabelAdapter.cs
- ValueQuery.cs
- WsatServiceAddress.cs
- PointF.cs
- QEncodedStream.cs
- IsolatedStorageException.cs
- AttachedProperty.cs
- XmlNamespaceMapping.cs
- TextEndOfSegment.cs
- StubHelpers.cs
- _RegBlobWebProxyDataBuilder.cs
- SaveFileDialogDesigner.cs
- FilterRepeater.cs
- nulltextnavigator.cs
- ThousandthOfEmRealDoubles.cs
- PersistenceProviderFactory.cs
- TabControl.cs