Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / XamlIntegration / PropertyReferenceExtension.cs / 1305376 / PropertyReferenceExtension.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.XamlIntegration { using System; using System.ComponentModel; using System.Runtime; using System.Windows.Markup; using System.Xml.Linq; using System.Xaml; using System.Reflection; [MarkupExtensionReturnType(typeof(object))] public sealed class PropertyReferenceExtension: MarkupExtension { public PropertyReferenceExtension() : base() { } public string PropertyName { get; set; } public override object ProvideValue(IServiceProvider serviceProvider) { if (!string.IsNullOrEmpty(this.PropertyName)) { object targetObject = ActivityWithResultConverter.GetRootTemplatedActivity(serviceProvider); if (targetObject != null) { PropertyDescriptor property = TypeDescriptor.GetProperties(targetObject)[PropertyName]; if (property != null) { return property.GetValue(targetObject); } } } throw FxTrace.Exception.AsError( new InvalidOperationException(SR.PropertyReferenceNotFound(this.PropertyName))); } } } // 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
- DupHandleConnectionReader.cs
- EmptyReadOnlyDictionaryInternal.cs
- OdbcConnectionHandle.cs
- InfoCardSymmetricAlgorithm.cs
- InstanceStore.cs
- InheritanceContextHelper.cs
- GeneralTransform.cs
- MarkupCompilePass1.cs
- printdlgexmarshaler.cs
- ZipIOExtraFieldElement.cs
- XmlSchemaObject.cs
- Utility.cs
- PropertyCollection.cs
- Point3DConverter.cs
- RunInstallerAttribute.cs
- StringStorage.cs
- _IPv6Address.cs
- WindowsScrollBarBits.cs
- TextTreeTextElementNode.cs
- TdsRecordBufferSetter.cs
- BoundColumn.cs
- ClientType.cs
- PasswordRecovery.cs
- Canvas.cs
- NativeActivityContext.cs
- UpDownBase.cs
- InvalidCastException.cs
- XmlSchemaComplexContentExtension.cs
- BaseDataListActionList.cs
- ValueTable.cs
- Tablet.cs
- ComponentDispatcherThread.cs
- StreamInfo.cs
- SBCSCodePageEncoding.cs
- PageBreakRecord.cs
- MemoryFailPoint.cs
- SmiEventSink.cs
- PreviewPrintController.cs
- CallId.cs
- ClientCultureInfo.cs
- Win32.cs
- MouseGestureConverter.cs
- CommandManager.cs
- BamlTreeNode.cs
- NonParentingControl.cs
- Attributes.cs
- ICollection.cs
- UpdatePanelTriggerCollection.cs
- EntityException.cs
- ASCIIEncoding.cs
- ServiceModelSectionGroup.cs
- X509ScopedServiceCertificateElementCollection.cs
- StaticResourceExtension.cs
- Dynamic.cs
- SiteMapDataSource.cs
- SynchronizedDispatch.cs
- Privilege.cs
- ExpressionConverter.cs
- IndexedString.cs
- BoolExpr.cs
- assemblycache.cs
- FullTextState.cs
- HtmlInputText.cs
- SyndicationFeed.cs
- BitmapImage.cs
- EditorServiceContext.cs
- DataGridViewCellStateChangedEventArgs.cs
- BindingParameterCollection.cs
- FormViewRow.cs
- EntityDataSourceChangingEventArgs.cs
- SyndicationItem.cs
- CanExecuteRoutedEventArgs.cs
- HandlerBase.cs
- TabletCollection.cs
- ListViewDataItem.cs
- InstanceCreationEditor.cs
- InputScope.cs
- ConfigurationValidatorAttribute.cs
- StreamInfo.cs
- IdentityManager.cs
- Configuration.cs
- MulticastOption.cs
- Path.cs
- BCLDebug.cs
- LocalizedNameDescriptionPair.cs
- RequestContext.cs
- StrongNameUtility.cs
- HttpException.cs
- SQLInt64Storage.cs
- smtpconnection.cs
- StylusPointDescription.cs
- CacheAxisQuery.cs
- DefaultBinder.cs
- SecurityHeaderElementInferenceEngine.cs
- Registry.cs
- EpmCustomContentDeSerializer.cs
- ApplicationContext.cs
- LexicalChunk.cs
- PeerCollaboration.cs
- XomlSerializationHelpers.cs