Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / Not.cs / 1305376 / Not.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Expressions { using System.Activities; using System.Activities.Validation; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Runtime; [SuppressMessage(FxCop.Category.Naming, FxCop.Rule.IdentifiersShouldNotMatchKeywords, Justification = "Optimizing for XAML naming. VB imperative users will [] qualify (e.g. New [Not])")] public sealed class Not: CodeActivity { //Lock is not needed for operationFunction here. The reason is that delegates for a given Not 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 Operand { get; set; } protected override void CacheMetadata(CodeActivityMetadata metadata) { UnaryExpressionHelper.OnGetArguments(metadata, this.Operand); if (operationFunction == null) { ValidationError validationError; if (!UnaryExpressionHelper.TryGenerateLinqDelegate(ExpressionType.Not, out operationFunction, out validationError)) { metadata.AddValidationError(validationError); } } } protected override TResult Execute(CodeActivityContext context) { Fx.Assert(operationFunction != null, "OperationFunction must exist."); TOperand operandValue = this.Operand.Get(context); return operationFunction(operandValue); } } } // 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
- ReaderWriterLockSlim.cs
- LogReserveAndAppendState.cs
- AppDomainUnloadedException.cs
- TcpChannelListener.cs
- KeyEventArgs.cs
- FormatSettings.cs
- UnsafeNativeMethodsCLR.cs
- CreateRefExpr.cs
- DataBindEngine.cs
- TreeNodeCollectionEditor.cs
- EventBindingService.cs
- Variable.cs
- InternalSendMessage.cs
- SafeNativeMethods.cs
- DataGridViewColumnConverter.cs
- SystemIcmpV4Statistics.cs
- IfJoinedCondition.cs
- Int32AnimationUsingKeyFrames.cs
- MarshalDirectiveException.cs
- OdbcRowUpdatingEvent.cs
- NumberFormatInfo.cs
- MsmqTransportSecurity.cs
- ResourceReferenceExpressionConverter.cs
- SelectionRange.cs
- RewritingPass.cs
- MetadataUtilsSmi.cs
- SslStreamSecurityElement.cs
- HttpRequest.cs
- ChtmlImageAdapter.cs
- ErrorFormatterPage.cs
- Soap.cs
- cookiecollection.cs
- StylesEditorDialog.cs
- M3DUtil.cs
- URLString.cs
- EventWaitHandle.cs
- PropagatorResult.cs
- OutgoingWebResponseContext.cs
- DateTimeValueSerializer.cs
- WebConvert.cs
- ComponentResourceManager.cs
- ThreadTrace.cs
- PtsContext.cs
- BufferedMessageData.cs
- CatalogPartCollection.cs
- AmbientLight.cs
- ColumnWidthChangedEvent.cs
- DataBindingHandlerAttribute.cs
- Wildcard.cs
- GridViewItemAutomationPeer.cs
- PasswordPropertyTextAttribute.cs
- CanExecuteRoutedEventArgs.cs
- ExtendedPropertyCollection.cs
- PropertyChangeTracker.cs
- ParagraphResult.cs
- CustomAttributeFormatException.cs
- AffineTransform3D.cs
- PrintEvent.cs
- EntityReference.cs
- RowBinding.cs
- RootProfilePropertySettingsCollection.cs
- httpserverutility.cs
- AuthenticationModuleElement.cs
- Compensate.cs
- PageSetupDialog.cs
- ModuleConfigurationInfo.cs
- LOSFormatter.cs
- ArgumentOutOfRangeException.cs
- TableLayoutColumnStyleCollection.cs
- XmlExtensionFunction.cs
- _SslState.cs
- EntityContainer.cs
- AppDomainFactory.cs
- AmbientEnvironment.cs
- ReferencedType.cs
- Handle.cs
- FamilyMapCollection.cs
- TypographyProperties.cs
- MouseEventArgs.cs
- SecureConversationVersion.cs
- RegexMatchCollection.cs
- CryptographicAttribute.cs
- ApplicationDirectory.cs
- DataGridCheckBoxColumn.cs
- ExceptionWrapper.cs
- MSG.cs
- ProxyHelper.cs
- CodeSnippetStatement.cs
- MouseActionConverter.cs
- ProfilePropertySettingsCollection.cs
- GeneralTransform.cs
- TextServicesLoader.cs
- UIElementPropertyUndoUnit.cs
- MergablePropertyAttribute.cs
- TextTreeDeleteContentUndoUnit.cs
- SafeNativeMethods.cs
- XPathDescendantIterator.cs
- HyperLink.cs
- TypeSource.cs
- RNGCryptoServiceProvider.cs