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
- AutomationIdentifierGuids.cs
- IPGlobalProperties.cs
- XmlSchemaSimpleContentExtension.cs
- FixedFindEngine.cs
- Unit.cs
- Vertex.cs
- OverrideMode.cs
- DataGridViewCellCancelEventArgs.cs
- ItemChangedEventArgs.cs
- Trigger.cs
- CustomCredentialPolicy.cs
- Int32AnimationUsingKeyFrames.cs
- XAMLParseException.cs
- InputLangChangeRequestEvent.cs
- FileSystemEnumerable.cs
- ConfigPathUtility.cs
- TypeDescriptorContext.cs
- RightsManagementPermission.cs
- ValidationSummary.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- ConfigurationStrings.cs
- SqlAliaser.cs
- ResourceDisplayNameAttribute.cs
- IndexingContentUnit.cs
- RelationshipEnd.cs
- InputManager.cs
- ScriptReferenceBase.cs
- MultiByteCodec.cs
- AppDomainProtocolHandler.cs
- EventToken.cs
- ConnectionPointCookie.cs
- AsyncDataRequest.cs
- Crypto.cs
- ActivityExecutorSurrogate.cs
- CurrencyWrapper.cs
- WindowsTokenRoleProvider.cs
- CursorConverter.cs
- TabControl.cs
- PropagatorResult.cs
- ScrollEventArgs.cs
- RightNameExpirationInfoPair.cs
- PrintDialog.cs
- DataControlFieldHeaderCell.cs
- XPathException.cs
- StorageSetMapping.cs
- ValidationUtility.cs
- _BaseOverlappedAsyncResult.cs
- DotExpr.cs
- ManagementOperationWatcher.cs
- CalendarKeyboardHelper.cs
- DrawingBrush.cs
- TableLayoutSettingsTypeConverter.cs
- ObjectStateManagerMetadata.cs
- AllMembershipCondition.cs
- ListItemCollection.cs
- ExportOptions.cs
- CalendarDesigner.cs
- DataObjectMethodAttribute.cs
- ConditionalAttribute.cs
- TrackingMemoryStreamFactory.cs
- IPipelineRuntime.cs
- TextDecorationCollection.cs
- _ScatterGatherBuffers.cs
- ListBox.cs
- OneWayChannelFactory.cs
- OleStrCAMarshaler.cs
- QueryOperatorEnumerator.cs
- ClientRuntimeConfig.cs
- XamlClipboardData.cs
- JsonCollectionDataContract.cs
- HtmlTableCell.cs
- XmlIterators.cs
- TdsParserStateObject.cs
- ExtenderProvidedPropertyAttribute.cs
- ConfigurationValues.cs
- WebPartMenu.cs
- BamlCollectionHolder.cs
- GeometryConverter.cs
- CqlErrorHelper.cs
- FaultContext.cs
- SafeArrayTypeMismatchException.cs
- CodeStatement.cs
- XPathNodeList.cs
- OracleSqlParser.cs
- MD5.cs
- TemplateControlCodeDomTreeGenerator.cs
- EastAsianLunisolarCalendar.cs
- Misc.cs
- StatusBarPanelClickEvent.cs
- SystemResourceHost.cs
- ActivityExecutor.cs
- Privilege.cs
- PerformanceCounterManager.cs
- MSHTMLHostUtil.cs
- BitmapEffectDrawingContextWalker.cs
- FixedPosition.cs
- XPathNodeHelper.cs
- HttpConfigurationContext.cs
- IgnoreSectionHandler.cs
- RenderOptions.cs