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
- IImplicitResourceProvider.cs
- WebPartZoneBase.cs
- StringKeyFrameCollection.cs
- BitmapEffectOutputConnector.cs
- ScriptHandlerFactory.cs
- PrivilegedConfigurationManager.cs
- WebEvents.cs
- XmlQueryStaticData.cs
- DataSourceControl.cs
- HtmlEmptyTagControlBuilder.cs
- MergeLocalizationDirectives.cs
- RoutedEvent.cs
- HttpServerVarsCollection.cs
- FixedSOMTableCell.cs
- SafeCryptContextHandle.cs
- GlyphingCache.cs
- CommonEndpointBehaviorElement.cs
- unsafenativemethodstextservices.cs
- ExceptionHandlers.cs
- CodeTypeMemberCollection.cs
- TableRowCollection.cs
- ImageKeyConverter.cs
- FtpWebRequest.cs
- AdornerLayer.cs
- CommandManager.cs
- DtdParser.cs
- ColorTranslator.cs
- RuntimeComponentFilter.cs
- FileSystemInfo.cs
- AndCondition.cs
- NavigationWindowAutomationPeer.cs
- Helpers.cs
- IntAverageAggregationOperator.cs
- SourceSwitch.cs
- OperationCanceledException.cs
- DrawingGroupDrawingContext.cs
- Options.cs
- FactoryGenerator.cs
- GrammarBuilderBase.cs
- DataTemplate.cs
- TreeWalkHelper.cs
- WinFormsUtils.cs
- ProfileSection.cs
- GridEntry.cs
- QueryExpression.cs
- ContentPlaceHolder.cs
- ActivationArguments.cs
- SessionState.cs
- ACE.cs
- FileSecurity.cs
- ToolboxItemCollection.cs
- DataGridViewComboBoxCell.cs
- WorkflowPersistenceService.cs
- ParsedAttributeCollection.cs
- IIS7UserPrincipal.cs
- OlePropertyStructs.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- WebPartConnectionsConfigureVerb.cs
- ProjectedSlot.cs
- NotFiniteNumberException.cs
- HwndKeyboardInputProvider.cs
- AuthorizationRuleCollection.cs
- AsyncWaitHandle.cs
- ListViewItemEventArgs.cs
- DefaultValueAttribute.cs
- KeyboardDevice.cs
- Funcletizer.cs
- XamlFxTrace.cs
- CuspData.cs
- CodeDesigner.cs
- ThicknessAnimationUsingKeyFrames.cs
- TrackBarRenderer.cs
- WebPartVerbCollection.cs
- MergePropertyDescriptor.cs
- OperatingSystem.cs
- PaintValueEventArgs.cs
- XmlSchemaSet.cs
- RoutedEventHandlerInfo.cs
- RTTypeWrapper.cs
- SynchronizationContext.cs
- MenuAdapter.cs
- ToolboxItemAttribute.cs
- ComUdtElement.cs
- AttachedAnnotationChangedEventArgs.cs
- ProxyWebPartConnectionCollection.cs
- TextBoxBase.cs
- PersonalizationStateInfoCollection.cs
- CapabilitiesUse.cs
- SplitterPanel.cs
- AppSettingsExpressionBuilder.cs
- RenamedEventArgs.cs
- WebPartConnectionCollection.cs
- KeyTime.cs
- CheckBoxList.cs
- ConstraintCollection.cs
- SqlLiftWhereClauses.cs
- DateTimeFormatInfo.cs
- VScrollProperties.cs
- XmlSignificantWhitespace.cs
- XmlChildNodes.cs