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
- WindowAutomationPeer.cs
- Container.cs
- TraceEventCache.cs
- Properties.cs
- webeventbuffer.cs
- InputScopeAttribute.cs
- Hash.cs
- RuntimeConfig.cs
- TCPClient.cs
- bidPrivateBase.cs
- ForwardPositionQuery.cs
- CqlBlock.cs
- ExtentKey.cs
- Int16Storage.cs
- Parallel.cs
- SettingsPropertyValueCollection.cs
- XsltContext.cs
- ClientOptions.cs
- CompletionBookmark.cs
- TextEncodedRawTextWriter.cs
- basevalidator.cs
- RegexCapture.cs
- RangeValueProviderWrapper.cs
- SerialStream.cs
- VectorAnimation.cs
- HtmlTableCellCollection.cs
- OutputCacheProfileCollection.cs
- StateManagedCollection.cs
- XmlNodeReader.cs
- CodeTypeDeclaration.cs
- ThreadStartException.cs
- COMException.cs
- CompilationRelaxations.cs
- SkipStoryboardToFill.cs
- DataGridBoolColumn.cs
- DataBoundControlParameterTarget.cs
- EncoderBestFitFallback.cs
- LogoValidationException.cs
- BindingBase.cs
- UserControlBuildProvider.cs
- ArcSegment.cs
- DateTimeFormatInfoScanner.cs
- ManagedFilter.cs
- ListViewItemMouseHoverEvent.cs
- TextRunCacheImp.cs
- FormatConvertedBitmap.cs
- Crypto.cs
- TemplateApplicationHelper.cs
- Symbol.cs
- AccessedThroughPropertyAttribute.cs
- RectConverter.cs
- UITypeEditor.cs
- DataGrid.cs
- WmlValidationSummaryAdapter.cs
- SqlDesignerDataSourceView.cs
- EntryIndex.cs
- XmlElementAttributes.cs
- BaseCodeDomTreeGenerator.cs
- RayHitTestParameters.cs
- DependencyObjectType.cs
- CommandLibraryHelper.cs
- GrammarBuilderBase.cs
- SchemaNamespaceManager.cs
- SQLBoolean.cs
- ComPlusContractBehavior.cs
- ToolZone.cs
- SchemaCollectionCompiler.cs
- GenericTextProperties.cs
- GacUtil.cs
- TagPrefixAttribute.cs
- SystemIcons.cs
- UserControl.cs
- CodeExpressionCollection.cs
- ObjectContext.cs
- ViewStateException.cs
- Rectangle.cs
- ObjectListDesigner.cs
- XmlArrayItemAttributes.cs
- MenuAdapter.cs
- RoutedEventArgs.cs
- WorkflowServiceHost.cs
- XmlSerializationReader.cs
- QilList.cs
- TemplatedWizardStep.cs
- AliasedSlot.cs
- dsa.cs
- columnmapkeybuilder.cs
- EdmError.cs
- WebServiceData.cs
- CodeTypeConstructor.cs
- cookieexception.cs
- GeometryConverter.cs
- DataPagerFieldItem.cs
- AutomationPatternInfo.cs
- SessionEndingEventArgs.cs
- QueryOutputWriter.cs
- ArrayElementGridEntry.cs
- ListChangedEventArgs.cs
- ConstraintConverter.cs
- KeysConverter.cs