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
- CodeRemoveEventStatement.cs
- HtmlControl.cs
- SqlResolver.cs
- AdCreatedEventArgs.cs
- DataPagerCommandEventArgs.cs
- ToolboxDataAttribute.cs
- IIS7ConfigurationLoader.cs
- ProcessThreadCollection.cs
- XmlWriterSettings.cs
- TypeExtensionConverter.cs
- DesignerInterfaces.cs
- GB18030Encoding.cs
- ClaimTypes.cs
- ComplexTypeEmitter.cs
- InputScopeManager.cs
- TableItemStyle.cs
- DocumentsTrace.cs
- DesignerPainter.cs
- XPathDescendantIterator.cs
- DataServiceProviderMethods.cs
- HyperLinkStyle.cs
- StrokeNodeEnumerator.cs
- PatternMatcher.cs
- PathSegmentCollection.cs
- shaperfactoryquerycachekey.cs
- CustomErrorsSectionWrapper.cs
- SkewTransform.cs
- AxHost.cs
- LocalBuilder.cs
- Console.cs
- DocumentPageViewAutomationPeer.cs
- CellPartitioner.cs
- TextSpan.cs
- MimeFormReflector.cs
- MemberProjectedSlot.cs
- SqlFlattener.cs
- XhtmlCssHandler.cs
- NodeFunctions.cs
- SqlXml.cs
- StorageEndPropertyMapping.cs
- ArrayWithOffset.cs
- OpenTypeCommon.cs
- DataAdapter.cs
- DelayDesigner.cs
- LassoSelectionBehavior.cs
- MembershipAdapter.cs
- WindowsListViewItemCheckBox.cs
- CommunicationException.cs
- LogLogRecordEnumerator.cs
- PerformanceCounterPermission.cs
- EdmProviderManifest.cs
- UpdateTranslator.cs
- SqlMethodAttribute.cs
- ExeContext.cs
- KnownTypeAttribute.cs
- Speller.cs
- TreeViewItem.cs
- ExtendedPropertiesHandler.cs
- ValuePattern.cs
- WebHttpSecurityElement.cs
- CachedPathData.cs
- XmlBinaryReader.cs
- DataGridRowEventArgs.cs
- ShadowGlyph.cs
- MethodSet.cs
- OleDbError.cs
- BaseCollection.cs
- FixedHyperLink.cs
- ValueTable.cs
- StoreItemCollection.cs
- DataError.cs
- WebContentFormatHelper.cs
- X509Certificate2.cs
- DocumentSchemaValidator.cs
- DbConnectionInternal.cs
- RuntimeArgumentHandle.cs
- EncryptedData.cs
- SafeSecurityHelper.cs
- SafeWaitHandle.cs
- DropDownButton.cs
- InternalPermissions.cs
- StylusPointPropertyInfoDefaults.cs
- SQLUtility.cs
- BrowserCapabilitiesFactory.cs
- RadioButtonFlatAdapter.cs
- ChangeBlockUndoRecord.cs
- SessionState.cs
- NameNode.cs
- Int64Converter.cs
- StylusButton.cs
- SoapCommonClasses.cs
- Identifier.cs
- EncryptedPackage.cs
- SqlError.cs
- X509PeerCertificateAuthenticationElement.cs
- AggregationMinMaxHelpers.cs
- OLEDB_Enum.cs
- SizeAnimation.cs
- XmlQueryContext.cs
- SqlInternalConnectionSmi.cs