Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / Equal.cs / 1305376 / Equal.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Expressions { using System.Activities; using System.Activities.Statements; using System.Linq.Expressions; using System.Activities.Validation; using System.Collections.Generic; using System.ComponentModel; using System.Runtime; public sealed class Equal: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given Equal 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.Equal, 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
- ImageListImageEditor.cs
- MenuItemBinding.cs
- UrlPath.cs
- DecoderExceptionFallback.cs
- ObjectQuery.cs
- UniqueEventHelper.cs
- AssociationEndMember.cs
- EntityViewGenerator.cs
- Guid.cs
- HashHelper.cs
- ProfessionalColorTable.cs
- ObjectContextServiceProvider.cs
- MailWriter.cs
- TripleDESCryptoServiceProvider.cs
- Sequence.cs
- XPathDocumentNavigator.cs
- DesignerLoader.cs
- VScrollProperties.cs
- ValidatingReaderNodeData.cs
- GradientStop.cs
- InstanceKeyView.cs
- HealthMonitoringSection.cs
- DecimalStorage.cs
- XmlNullResolver.cs
- ToolZoneDesigner.cs
- IsolatedStorageException.cs
- HwndSubclass.cs
- SupportsEventValidationAttribute.cs
- Stroke2.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- BaseServiceProvider.cs
- AsyncOperation.cs
- GroupItem.cs
- EmptyEnumerable.cs
- HttpModulesSection.cs
- BinaryObjectInfo.cs
- ScalarOps.cs
- DeviceSpecificChoice.cs
- CodeRegionDirective.cs
- CommonGetThemePartSize.cs
- DebugView.cs
- OracleRowUpdatingEventArgs.cs
- CodeCommentStatement.cs
- SectionVisual.cs
- TableLayoutStyleCollection.cs
- HitTestDrawingContextWalker.cs
- ReadWriteSpinLock.cs
- HMACSHA256.cs
- SynchronizationLockException.cs
- storepermission.cs
- uribuilder.cs
- StyleCollection.cs
- AutoCompleteStringCollection.cs
- RegexParser.cs
- TypeViewSchema.cs
- XsltSettings.cs
- DataGridItemAttachedStorage.cs
- sitestring.cs
- ZipIOCentralDirectoryBlock.cs
- QuaternionRotation3D.cs
- XslCompiledTransform.cs
- CacheAxisQuery.cs
- templategroup.cs
- TableHeaderCell.cs
- FontSourceCollection.cs
- MouseEvent.cs
- AcceleratedTokenProviderState.cs
- ActivityExecutor.cs
- Expression.cs
- RawTextInputReport.cs
- CachedCompositeFamily.cs
- PackWebResponse.cs
- DelegateArgumentValue.cs
- RepeatButtonAutomationPeer.cs
- SerializationObjectManager.cs
- DebugViewWriter.cs
- CmsInterop.cs
- DataGridColumn.cs
- StorageEntitySetMapping.cs
- remotingproxy.cs
- RewritingProcessor.cs
- HttpProfileBase.cs
- CodeGeneratorAttribute.cs
- ExpressionReplacer.cs
- AsyncPostBackTrigger.cs
- DecoderBestFitFallback.cs
- PropertyTabChangedEvent.cs
- UnsignedPublishLicense.cs
- UnmanagedMemoryStreamWrapper.cs
- ResXFileRef.cs
- ReceiveActivityDesigner.cs
- BlurEffect.cs
- ObservableCollection.cs
- Accessors.cs
- DoubleConverter.cs
- TextTreeTextBlock.cs
- TreeViewItemAutomationPeer.cs
- FieldNameLookup.cs
- ResourcesBuildProvider.cs
- SyndicationPerson.cs