Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / DelegateArgumentValue.cs / 1305376 / DelegateArgumentValue.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Expressions { using System.Linq.Expressions; using System.Runtime; using System.Windows.Markup; [ContentProperty("DelegateArgument")] public sealed class DelegateArgumentValue: CodeActivity , IExpressionContainer { public DelegateArgumentValue() : base() { } public DelegateArgumentValue(DelegateArgument delegateArgument) : this() { this.DelegateArgument = delegateArgument; } public DelegateArgument DelegateArgument { get; set; } Expression IExpressionContainer.Expression { get { return ExpressionUtilities.CreateIdentifierExpression(this.DelegateArgument); } } protected override void CacheMetadata(CodeActivityMetadata metadata) { if (this.DelegateArgument == null) { metadata.AddValidationError(SR.DelegateArgumentMustBeSet); } else { if (!this.DelegateArgument.IsInTree) { metadata.AddValidationError(SR.DelegateArgumentMustBeReferenced(this.DelegateArgument.Name)); } if (!metadata.Environment.IsVisible(this.DelegateArgument)) { metadata.AddValidationError(SR.DelegateArgumentNotVisible(this.DelegateArgument.Name)); } if (!(this.DelegateArgument is DelegateInArgument ) && !TypeHelper.AreTypesCompatible(this.DelegateArgument.Type, typeof(T))) { metadata.AddValidationError(SR.DelegateArgumentTypeInvalid(this.DelegateArgument, typeof(T), this.DelegateArgument.Type)); } } } internal override bool TryGetValue(ActivityContext context, out T value) { try { context.AllowChainedEnvironmentAccess = true; value = context.GetValue ((LocationReference)this.DelegateArgument); } finally { context.AllowChainedEnvironmentAccess = false; } return true; } protected override T Execute(CodeActivityContext context) { return ExecuteWithTryGetValue(context); } } } // 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
- WebPartEditorApplyVerb.cs
- BuildProvider.cs
- TabletDevice.cs
- NamespaceList.cs
- DBNull.cs
- ServiceBusyException.cs
- ThemeDictionaryExtension.cs
- CompareValidator.cs
- TypeLibConverter.cs
- TrackingMemoryStreamFactory.cs
- TypeElement.cs
- ModelPropertyCollectionImpl.cs
- ControlPropertyNameConverter.cs
- CodeGenerator.cs
- OleDbException.cs
- WebConfigurationHostFileChange.cs
- WinHttpWebProxyFinder.cs
- XmlMapping.cs
- SystemIcmpV6Statistics.cs
- CompilerCollection.cs
- XmlAttributeProperties.cs
- SendKeys.cs
- BindingSourceDesigner.cs
- wmiprovider.cs
- CacheSection.cs
- VisualBasicExpressionConverter.cs
- SaveFileDialog.cs
- BoundField.cs
- PropertyValue.cs
- PersonalizationProvider.cs
- ToolStripDropDownItem.cs
- DateTimeConverter2.cs
- LockedActivityGlyph.cs
- HttpCachePolicyElement.cs
- InfocardChannelParameter.cs
- Stopwatch.cs
- ConfigurationManager.cs
- TimeZone.cs
- ConfigXmlCDataSection.cs
- RichTextBoxContextMenu.cs
- TextProperties.cs
- NumberAction.cs
- InkSerializer.cs
- ColorAnimationBase.cs
- ParameterCollection.cs
- HostExecutionContextManager.cs
- AnimatedTypeHelpers.cs
- StrokeNode.cs
- WebPartManagerInternals.cs
- RelatedEnd.cs
- SystemColorTracker.cs
- _NestedMultipleAsyncResult.cs
- X500Name.cs
- SharedTcpTransportManager.cs
- SoapIncludeAttribute.cs
- SharingService.cs
- BitmapCodecInfo.cs
- AnnotationHighlightLayer.cs
- SmtpException.cs
- webbrowsersite.cs
- ReadOnlyCollection.cs
- IChannel.cs
- ConfigXmlDocument.cs
- XmlCollation.cs
- HandlerFactoryCache.cs
- LongValidator.cs
- AutomationPeer.cs
- StrokeNodeEnumerator.cs
- NavigationFailedEventArgs.cs
- LabelDesigner.cs
- TemplateBamlTreeBuilder.cs
- fixedPageContentExtractor.cs
- RequestCachePolicyConverter.cs
- SamlSerializer.cs
- ThrowHelper.cs
- precedingsibling.cs
- JpegBitmapDecoder.cs
- BasicAsyncResult.cs
- BitSet.cs
- BoundingRectTracker.cs
- NonBatchDirectoryCompiler.cs
- NameTable.cs
- DataObjectPastingEventArgs.cs
- BoundColumn.cs
- TerminateDesigner.cs
- EntityViewGenerationConstants.cs
- ComponentResourceKeyConverter.cs
- PropertyFilter.cs
- TabControl.cs
- login.cs
- Nullable.cs
- HwndAppCommandInputProvider.cs
- SelectionItemPattern.cs
- XMLUtil.cs
- InvokeSchedule.cs
- XmlReflectionMember.cs
- Floater.cs
- SqlConnectionHelper.cs
- UserControl.cs
- ActivityInterfaces.cs