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
- FormViewUpdateEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- sqlser.cs
- ApplicationManager.cs
- CorrelationResolver.cs
- EventTrigger.cs
- ArgumentOutOfRangeException.cs
- DesignerSerializerAttribute.cs
- RIPEMD160Managed.cs
- NameSpaceEvent.cs
- PageRequestManager.cs
- ControlDesigner.cs
- xdrvalidator.cs
- SizeAnimationUsingKeyFrames.cs
- ContentOperations.cs
- UnsafeNativeMethods.cs
- OleDbEnumerator.cs
- AggregatePushdown.cs
- DataSvcMapFileSerializer.cs
- PrintControllerWithStatusDialog.cs
- Parser.cs
- SizeChangedInfo.cs
- CodeCatchClauseCollection.cs
- RequestQueue.cs
- ButtonBaseAutomationPeer.cs
- Clipboard.cs
- ValidationSummary.cs
- MaskedTextBox.cs
- ImageKeyConverter.cs
- GraphicsPath.cs
- CodeLabeledStatement.cs
- BamlRecords.cs
- SmtpFailedRecipientsException.cs
- ConfigXmlText.cs
- SearchForVirtualItemEventArgs.cs
- DomainConstraint.cs
- MethodCallTranslator.cs
- ToolStripRenderEventArgs.cs
- MatrixTransform.cs
- PropertyMappingExceptionEventArgs.cs
- InvalidTimeZoneException.cs
- ExpressionBuilder.cs
- DataGridItemCollection.cs
- DesignerAttribute.cs
- DataViewManagerListItemTypeDescriptor.cs
- SplitterCancelEvent.cs
- PersonalizablePropertyEntry.cs
- IgnoreDeviceFilterElementCollection.cs
- BufferAllocator.cs
- MDIClient.cs
- CodeRemoveEventStatement.cs
- ProgressBar.cs
- HelpPage.cs
- StructuredTypeEmitter.cs
- PtsContext.cs
- SQLStringStorage.cs
- ExceptionCollection.cs
- DataGridViewCellCollection.cs
- RegisteredScript.cs
- HtmlContainerControl.cs
- RuleInfoComparer.cs
- SafeNativeMethods.cs
- EntityCommandExecutionException.cs
- MimeReturn.cs
- SafeReversePInvokeHandle.cs
- ListViewTableCell.cs
- TcpServerChannel.cs
- DataGrid.cs
- TextHintingModeValidation.cs
- StrokeRenderer.cs
- ComponentGlyph.cs
- IntranetCredentialPolicy.cs
- MenuAdapter.cs
- HMACSHA256.cs
- CompareValidator.cs
- StringOutput.cs
- UndirectedGraph.cs
- arc.cs
- GlyphRunDrawing.cs
- Relationship.cs
- MSG.cs
- UnsafeNativeMethods.cs
- ADConnectionHelper.cs
- AspCompat.cs
- RenderDataDrawingContext.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- MobileControlsSectionHelper.cs
- WebContentFormatHelper.cs
- CompareInfo.cs
- SQLGuidStorage.cs
- MarkupProperty.cs
- UIElement3D.cs
- RequestQueue.cs
- OptimalTextSource.cs
- URI.cs
- ObjectItemAttributeAssemblyLoader.cs
- TextDecorations.cs
- LicenseContext.cs
- ComponentDispatcherThread.cs
- CssClassPropertyAttribute.cs