Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- BaseCodePageEncoding.cs
- Soap.cs
- UserControlCodeDomTreeGenerator.cs
- Constraint.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- ComPlusAuthorization.cs
- ConfigXmlAttribute.cs
- WebPartZone.cs
- QueryOptionExpression.cs
- HostExecutionContextManager.cs
- LabelAutomationPeer.cs
- SpellerInterop.cs
- FormsAuthenticationUser.cs
- ObjectQuery.cs
- Simplifier.cs
- WebBrowserBase.cs
- SqlProfileProvider.cs
- CustomExpression.cs
- SqlServices.cs
- EntityDataSourceDesigner.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- ControllableStoryboardAction.cs
- ToolStripGrip.cs
- KeyEventArgs.cs
- latinshape.cs
- SimpleLine.cs
- RoutedEventValueSerializer.cs
- XmlHelper.cs
- PageAsyncTask.cs
- MessageQueueException.cs
- NameSpaceExtractor.cs
- FontFamilyIdentifier.cs
- PanelStyle.cs
- ActiveXHelper.cs
- ErrorFormatterPage.cs
- util.cs
- SourceFileInfo.cs
- InheritanceUI.cs
- TextRangeProviderWrapper.cs
- IndentTextWriter.cs
- ResourceProperty.cs
- CompiledIdentityConstraint.cs
- StatusBarAutomationPeer.cs
- XmlEntityReference.cs
- TdsParserSessionPool.cs
- SessionIDManager.cs
- ContainerAction.cs
- XmlLanguageConverter.cs
- MatrixAnimationUsingPath.cs
- HelpProvider.cs
- Listbox.cs
- MouseEvent.cs
- HelloOperationCD1AsyncResult.cs
- PassportIdentity.cs
- BidOverLoads.cs
- ColumnResizeAdorner.cs
- AvTrace.cs
- oledbmetadatacollectionnames.cs
- InvalidOperationException.cs
- DataGridViewSelectedRowCollection.cs
- RectConverter.cs
- StaticExtension.cs
- WebRequestModuleElementCollection.cs
- TextAction.cs
- TriggerCollection.cs
- DetailsViewRow.cs
- XmlEntityReference.cs
- NumberAction.cs
- CommonProperties.cs
- Token.cs
- EntityDataSourceWrapperCollection.cs
- StylusEditingBehavior.cs
- TextTreeExtractElementUndoUnit.cs
- SafeRightsManagementEnvironmentHandle.cs
- WebResourceUtil.cs
- ErrorHandlingAcceptor.cs
- StringResourceManager.cs
- RoutedCommand.cs
- TokenBasedSetEnumerator.cs
- OleDbConnectionFactory.cs
- XmlBoundElement.cs
- DeploymentSectionCache.cs
- WindowsToolbar.cs
- SupportingTokenDuplexChannel.cs
- OracleConnection.cs
- UndirectedGraph.cs
- SystemEvents.cs
- WindowsAuthenticationModule.cs
- InstanceOwnerQueryResult.cs
- DefaultSection.cs
- BufferBuilder.cs
- TableSectionStyle.cs
- XmlSchemaProviderAttribute.cs
- EnumerationRangeValidationUtil.cs
- WithStatement.cs
- Authorization.cs
- InkCanvasAutomationPeer.cs
- CalendarTable.cs
- ServiceObjectContainer.cs
- OneOfConst.cs