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
- FloaterBaseParaClient.cs
- ZipQueryOperator.cs
- XmlImplementation.cs
- CodeNamespaceImportCollection.cs
- CodeTypeReferenceCollection.cs
- NetworkInformationPermission.cs
- XmlLinkedNode.cs
- EnumerableWrapperWeakToStrong.cs
- Material.cs
- DefaultSerializationProviderAttribute.cs
- WebFormsRootDesigner.cs
- Keywords.cs
- LinkArea.cs
- PropertyNames.cs
- Bits.cs
- Menu.cs
- ControlCollection.cs
- IfJoinedCondition.cs
- TypedTableBaseExtensions.cs
- ColumnTypeConverter.cs
- ControlUtil.cs
- HTTPNotFoundHandler.cs
- MonthChangedEventArgs.cs
- TextElementEnumerator.cs
- TextRunCacheImp.cs
- OracleBinary.cs
- PenContexts.cs
- DataViewSettingCollection.cs
- XpsFilter.cs
- RelativeSource.cs
- WrappedIUnknown.cs
- XamlTemplateSerializer.cs
- OleAutBinder.cs
- ReferenceEqualityComparer.cs
- IconConverter.cs
- HttpEncoder.cs
- PagePropertiesChangingEventArgs.cs
- ConnectionManagementElement.cs
- DrawingGroup.cs
- UserControlParser.cs
- WindowVisualStateTracker.cs
- BinaryParser.cs
- WebBaseEventKeyComparer.cs
- XmlSchemaObjectCollection.cs
- AttributeData.cs
- AdjustableArrowCap.cs
- AutoSizeComboBox.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- MatchingStyle.cs
- HttpStaticObjectsCollectionWrapper.cs
- ToolboxComponentsCreatedEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- RawUIStateInputReport.cs
- AnimationClockResource.cs
- HierarchicalDataTemplate.cs
- BamlLocalizer.cs
- EventTrigger.cs
- WebPartDisplayMode.cs
- XhtmlBasicTextViewAdapter.cs
- SourceItem.cs
- OrderPreservingPipeliningSpoolingTask.cs
- EnumUnknown.cs
- DataGridViewIntLinkedList.cs
- TimeSpanFormat.cs
- PtsPage.cs
- ClientTargetCollection.cs
- KeyedCollection.cs
- SignatureHelper.cs
- MatrixCamera.cs
- ObjectItemAssemblyLoader.cs
- EffectiveValueEntry.cs
- SoapExtensionStream.cs
- Evaluator.cs
- MediaContextNotificationWindow.cs
- Quad.cs
- ListViewTableRow.cs
- HttpStreamFormatter.cs
- PathGeometry.cs
- TraceHwndHost.cs
- BaseComponentEditor.cs
- ProtocolElement.cs
- StructuredTypeInfo.cs
- FixedBufferAttribute.cs
- WebPartConnectVerb.cs
- XmlValidatingReaderImpl.cs
- DataSourceCache.cs
- SqlConnectionFactory.cs
- InvalidComObjectException.cs
- IFlowDocumentViewer.cs
- EditorPartChrome.cs
- ObjectDataSourceWizardForm.cs
- SafeProcessHandle.cs
- XPathNodeIterator.cs
- UserControlParser.cs
- ShaderEffect.cs
- WindowsTokenRoleProvider.cs
- DataGridViewDataConnection.cs
- WebPartChrome.cs
- SendKeys.cs
- DataServiceQueryException.cs