Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / FrameworkContentElementAutomationPeer.cs / 1305600 / FrameworkContentElementAutomationPeer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: FrameworkContentElementAutomationPeer.cs // // Description: AutomationPeer associated with FrameworkContnetElement. // //--------------------------------------------------------------------------- using System.Windows.Markup; // DefinitionProperties using System.Windows.Controls; // Label namespace System.Windows.Automation.Peers { ////// AutomationPeer associated with FrameworkContentElement. /// public class FrameworkContentElementAutomationPeer : ContentElementAutomationPeer { ////// Constructor. /// /// Owner of the AutomationPeer. public FrameworkContentElementAutomationPeer(FrameworkContentElement owner) : base(owner) { } ////// protected override string GetAutomationIdCore() { // 1. fetch AutomationProperties.AutomationIdProperty string result = base.GetAutomationIdCore(); if (string.IsNullOrEmpty(result)) { // 2. fetch x:Uid // Uid's do not appear on content elements. // result = DefinitionProperties.GetUid(Owner); if (string.IsNullOrEmpty(result)) { // 3. fetch FrameworkElement.NameProperty result = ((FrameworkContentElement)Owner).Name; } } return result == null ? string.Empty : result; } /// protected override string GetHelpTextCore() { string result = base.GetHelpTextCore(); if (string.IsNullOrEmpty(result)) { object toolTip = ((FrameworkContentElement)Owner).ToolTip; if (toolTip != null) { result = toolTip as string; if (string.IsNullOrEmpty(result)) { FrameworkElement toolTipElement = toolTip as FrameworkElement; if (toolTipElement != null) result = toolTipElement.GetPlainText(); } } } return result ?? String.Empty; } /// override protected AutomationPeer GetLabeledByCore() { AutomationPeer labelPeer = base.GetLabeledByCore(); if (labelPeer == null) { Label label = Label.GetLabeledBy(Owner); if (label != null) return label.GetAutomationPeer(); } return labelPeer; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EntityViewContainer.cs
- EmptyArray.cs
- SafeNativeMethods.cs
- Inline.cs
- Pen.cs
- NetworkInformationException.cs
- TreeViewImageKeyConverter.cs
- ContractUtils.cs
- WebPartRestoreVerb.cs
- PreservationFileReader.cs
- LocationEnvironment.cs
- ApplicationBuildProvider.cs
- Int16Animation.cs
- X509ClientCertificateAuthenticationElement.cs
- SQLGuidStorage.cs
- X509Certificate2Collection.cs
- BitmapEffectCollection.cs
- X509Certificate2Collection.cs
- ClientTargetSection.cs
- HtmlWindowCollection.cs
- ConfigurationValues.cs
- DropAnimation.xaml.cs
- ToolStripItemRenderEventArgs.cs
- Operator.cs
- HasCopySemanticsAttribute.cs
- MeshGeometry3D.cs
- SessionPageStatePersister.cs
- HealthMonitoringSection.cs
- DataBindingCollection.cs
- ScrollEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- MethodSignatureGenerator.cs
- MappingException.cs
- FixedSOMImage.cs
- OrderedHashRepartitionEnumerator.cs
- ChannelToken.cs
- RectangleF.cs
- AccessKeyManager.cs
- Html32TextWriter.cs
- TimersDescriptionAttribute.cs
- ActivityXRefConverter.cs
- SynchronizationContextHelper.cs
- ElementAtQueryOperator.cs
- MLangCodePageEncoding.cs
- ConfigurationManagerInternal.cs
- EnumUnknown.cs
- HttpCookie.cs
- DisableDpiAwarenessAttribute.cs
- CodeParameterDeclarationExpression.cs
- LinqDataSourceValidationException.cs
- Int32Converter.cs
- ClientSession.cs
- ThreadStartException.cs
- UnsafeNativeMethodsMilCoreApi.cs
- WpfGeneratedKnownProperties.cs
- MissingManifestResourceException.cs
- HttpListenerRequest.cs
- ColorContextHelper.cs
- PageThemeBuildProvider.cs
- LayoutTableCell.cs
- FlatButtonAppearance.cs
- LiteralControl.cs
- Timer.cs
- FormatException.cs
- ChangeDirector.cs
- CounterCreationData.cs
- Rule.cs
- Root.cs
- EnumBuilder.cs
- WindowsTooltip.cs
- TextDecorationLocationValidation.cs
- Floater.cs
- SystemUdpStatistics.cs
- OdbcStatementHandle.cs
- MemberCollection.cs
- PageParserFilter.cs
- SmiMetaDataProperty.cs
- XmlStreamStore.cs
- PackagingUtilities.cs
- PreApplicationStartMethodAttribute.cs
- CssTextWriter.cs
- SmiRecordBuffer.cs
- IconEditor.cs
- URLIdentityPermission.cs
- ProcessHostServerConfig.cs
- ConfigsHelper.cs
- MouseButtonEventArgs.cs
- ThaiBuddhistCalendar.cs
- ToolStripDropDownClosingEventArgs.cs
- WebMessageBodyStyleHelper.cs
- HttpProfileGroupBase.cs
- ConfigurationManagerInternalFactory.cs
- ScrollableControl.cs
- PopOutPanel.cs
- RequiredFieldValidator.cs
- Properties.cs
- TypeConvertions.cs
- AsyncCompletedEventArgs.cs
- BitmapSource.cs
- LoginViewDesigner.cs