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
- Missing.cs
- ArrayListCollectionBase.cs
- UIHelper.cs
- EntityDataSourceQueryBuilder.cs
- RoutedEventArgs.cs
- XDRSchema.cs
- UnSafeCharBuffer.cs
- ProxyHelper.cs
- InkCollectionBehavior.cs
- metrodevice.cs
- SystemColorTracker.cs
- GridErrorDlg.cs
- HttpRequestCacheValidator.cs
- DefaultValueConverter.cs
- InternalEnumValidatorAttribute.cs
- XmlRawWriter.cs
- _CookieModule.cs
- Hash.cs
- ColorAnimationBase.cs
- MonitoringDescriptionAttribute.cs
- CharEntityEncoderFallback.cs
- DataRelationPropertyDescriptor.cs
- DBConnection.cs
- AmbiguousMatchException.cs
- WebControlParameterProxy.cs
- X509Certificate2.cs
- TemplateBuilder.cs
- OutputCacheProfile.cs
- FamilyCollection.cs
- HtmlWindowCollection.cs
- SafeFindHandle.cs
- Stack.cs
- FunctionOverloadResolver.cs
- ObjectItemCollection.cs
- _KerberosClient.cs
- ListContractAdapter.cs
- Simplifier.cs
- RadioButtonList.cs
- GeometryHitTestResult.cs
- Verify.cs
- GatewayIPAddressInformationCollection.cs
- DataGridCaption.cs
- COM2PropertyBuilderUITypeEditor.cs
- PointAnimationBase.cs
- InputMethodStateChangeEventArgs.cs
- CounterSample.cs
- XmlSchemaAnyAttribute.cs
- JulianCalendar.cs
- SqlDataSourceView.cs
- ProfileManager.cs
- SqlDataSourceQueryConverter.cs
- EventLogRecord.cs
- OraclePermissionAttribute.cs
- XmlWriter.cs
- OdbcCommandBuilder.cs
- PointAnimation.cs
- EntityDataSourceReferenceGroup.cs
- DataObjectSettingDataEventArgs.cs
- HtmlWindowCollection.cs
- CodePrimitiveExpression.cs
- FormClosedEvent.cs
- DataServiceResponse.cs
- WorkflowDesignerColors.cs
- SerializationObjectManager.cs
- ParameterToken.cs
- EndpointNotFoundException.cs
- XmlSchemaSet.cs
- AtomParser.cs
- Rectangle.cs
- XPathBinder.cs
- SubqueryTrackingVisitor.cs
- ProviderConnectionPointCollection.cs
- SqlXmlStorage.cs
- SeparatorAutomationPeer.cs
- ValueTypeFixupInfo.cs
- FixedNode.cs
- DataConnectionHelper.cs
- DefaultSettingsSection.cs
- DefaultTypeArgumentAttribute.cs
- ConfigurationManagerHelper.cs
- WindowsEditBoxRange.cs
- ProcessHostServerConfig.cs
- FormsAuthenticationEventArgs.cs
- TextShapeableCharacters.cs
- ExpanderAutomationPeer.cs
- SoapExtensionReflector.cs
- ThemeableAttribute.cs
- WebResponse.cs
- ComponentGuaranteesAttribute.cs
- MaskInputRejectedEventArgs.cs
- XmlILIndex.cs
- ImageMap.cs
- RuntimeConfigLKG.cs
- SqlParameter.cs
- DesignerAttributeInfo.cs
- Timer.cs
- odbcmetadatacollectionnames.cs
- RedistVersionInfo.cs
- BitmapCodecInfoInternal.cs
- EntityContainerAssociationSet.cs