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
- FindCriteria.cs
- GlobalProxySelection.cs
- CodeLabeledStatement.cs
- ConsoleEntryPoint.cs
- InvokeProviderWrapper.cs
- StrongNameUtility.cs
- EntityTypeEmitter.cs
- TransformerInfoCollection.cs
- _NegoStream.cs
- SqlLiftIndependentRowExpressions.cs
- EventProvider.cs
- WorkflowOwnershipException.cs
- FixedSOMLineRanges.cs
- AssemblyHash.cs
- FileDialog.cs
- WebBrowsableAttribute.cs
- MetadataWorkspace.cs
- ZoneLinkButton.cs
- CodeTypeDelegate.cs
- ResourceLoader.cs
- PeerNameRegistration.cs
- SignatureHelper.cs
- BrowserDefinitionCollection.cs
- XhtmlCssHandler.cs
- InputLangChangeEvent.cs
- HuffModule.cs
- PrintDialogException.cs
- UnionCodeGroup.cs
- String.cs
- DataGridHeaderBorder.cs
- BasicExpandProvider.cs
- WebResponse.cs
- AccessedThroughPropertyAttribute.cs
- BypassElementCollection.cs
- XmlQualifiedNameTest.cs
- WorkflowRuntimeServicesBehavior.cs
- FocusChangedEventArgs.cs
- ConfigurationException.cs
- ReachDocumentPageSerializer.cs
- Command.cs
- SocketStream.cs
- PolyBezierSegment.cs
- ControlPropertyNameConverter.cs
- RenameRuleObjectDialog.cs
- XPathChildIterator.cs
- SHA256Managed.cs
- OutputCache.cs
- ContentFilePart.cs
- BamlLocalizationDictionary.cs
- EntityDataSourceWrapper.cs
- RemotingServices.cs
- InlinedAggregationOperator.cs
- Exception.cs
- SymmetricKeyWrap.cs
- DetailsViewActionList.cs
- SqlDataSourceCommandEventArgs.cs
- ColorIndependentAnimationStorage.cs
- InvalidWMPVersionException.cs
- MdiWindowListStrip.cs
- PrintDocument.cs
- SearchForVirtualItemEventArgs.cs
- WindowsGraphics.cs
- SqlRewriteScalarSubqueries.cs
- ConstructorBuilder.cs
- KeyValuePairs.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- CreateWorkflowOwnerCommand.cs
- D3DImage.cs
- FusionWrap.cs
- CollectionViewGroup.cs
- ImageListStreamer.cs
- NotCondition.cs
- MediaContext.cs
- BinHexDecoder.cs
- TypeElement.cs
- XmlTypeMapping.cs
- ToolStripTextBox.cs
- WindowsPrincipal.cs
- RayHitTestParameters.cs
- WebPartMinimizeVerb.cs
- ProfileService.cs
- RelationshipFixer.cs
- Configuration.cs
- ToRequest.cs
- SqlConnection.cs
- WindowsFormsSynchronizationContext.cs
- SerializationStore.cs
- HwndTarget.cs
- ToolStripPanelRenderEventArgs.cs
- DataKey.cs
- NameValueSectionHandler.cs
- ModuleBuilder.cs
- ErrorStyle.cs
- DataGridViewCell.cs
- Int32RectValueSerializer.cs
- DashStyle.cs
- KeyConverter.cs
- MissingManifestResourceException.cs
- UriSectionReader.cs
- WebPartUtil.cs