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
- XmlReturnReader.cs
- GestureRecognitionResult.cs
- Slider.cs
- ellipse.cs
- AsyncStreamReader.cs
- RegisteredDisposeScript.cs
- WindowsGraphics.cs
- CacheSection.cs
- ScaleTransform.cs
- LayoutUtils.cs
- BorderGapMaskConverter.cs
- CatalogPartChrome.cs
- EmbeddedObject.cs
- TextParaLineResult.cs
- HybridDictionary.cs
- BackStopAuthenticationModule.cs
- DecimalAnimationUsingKeyFrames.cs
- ListSortDescription.cs
- MouseBinding.cs
- PropertyEmitterBase.cs
- TrustManagerPromptUI.cs
- followingsibling.cs
- TimeIntervalCollection.cs
- IsolationInterop.cs
- DeferredTextReference.cs
- SqlParameterizer.cs
- SqlBuffer.cs
- CompilerState.cs
- VirtualPath.cs
- XmlTextEncoder.cs
- PersonalizableAttribute.cs
- ErrorEventArgs.cs
- FixedNode.cs
- BamlBinaryWriter.cs
- XsltFunctions.cs
- TextEditorCopyPaste.cs
- SimpleTypeResolver.cs
- ObjectDataSourceStatusEventArgs.cs
- TypeLoadException.cs
- KoreanLunisolarCalendar.cs
- ManualResetEventSlim.cs
- AttachedAnnotation.cs
- SqlFileStream.cs
- xsdvalidator.cs
- CursorInteropHelper.cs
- ReachSerializerAsync.cs
- tibetanshape.cs
- SettingsAttributes.cs
- QilIterator.cs
- RegexFCD.cs
- Latin1Encoding.cs
- ColumnHeaderConverter.cs
- ThemeDirectoryCompiler.cs
- StylusCollection.cs
- DataTableExtensions.cs
- OutputScope.cs
- FileLevelControlBuilderAttribute.cs
- OutOfProcStateClientManager.cs
- LinqDataSourceHelper.cs
- ListViewPagedDataSource.cs
- DataGridViewSelectedColumnCollection.cs
- DataColumnCollection.cs
- COAUTHINFO.cs
- IndentedWriter.cs
- SoapSchemaExporter.cs
- ObjRef.cs
- ObjectIDGenerator.cs
- IntranetCredentialPolicy.cs
- Environment.cs
- DesignerLoader.cs
- Guid.cs
- ColumnResult.cs
- TripleDESCryptoServiceProvider.cs
- ImageCollectionEditor.cs
- ActivityTypeResolver.xaml.cs
- HttpResponseHeader.cs
- PropertyChangeTracker.cs
- ToolboxItemCollection.cs
- CircleEase.cs
- NativeMethods.cs
- SessionStateModule.cs
- DesignerActionGlyph.cs
- BamlResourceDeserializer.cs
- UnsafeNativeMethods.cs
- HttpFileCollection.cs
- ToolboxItemImageConverter.cs
- OperatingSystem.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- GridLength.cs
- UmAlQuraCalendar.cs
- XPathAxisIterator.cs
- XNodeNavigator.cs
- XsdDuration.cs
- InputEventArgs.cs
- XPathNode.cs
- CacheAxisQuery.cs
- ImageAnimator.cs
- PolyLineSegmentFigureLogic.cs
- MD5.cs
- SqlDependency.cs