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
- DefinitionBase.cs
- HMACRIPEMD160.cs
- ExtensionQuery.cs
- HttpRuntimeSection.cs
- DependencyProperty.cs
- EntityCommandExecutionException.cs
- SchemaElementLookUpTable.cs
- RIPEMD160.cs
- EncoderParameters.cs
- FlagsAttribute.cs
- TitleStyle.cs
- BaseConfigurationRecord.cs
- SecurityPermission.cs
- SafePointer.cs
- EpmSyndicationContentDeSerializer.cs
- DetailsViewInsertEventArgs.cs
- SimpleType.cs
- RegexRunnerFactory.cs
- _FixedSizeReader.cs
- HTTPNotFoundHandler.cs
- AnnotationComponentManager.cs
- BitmapEffectDrawing.cs
- DocumentGridContextMenu.cs
- PathTooLongException.cs
- CodeFieldReferenceExpression.cs
- QfeChecker.cs
- DataRowExtensions.cs
- ShapeTypeface.cs
- ManipulationInertiaStartingEventArgs.cs
- FormatVersion.cs
- CorrelationScope.cs
- Roles.cs
- FontSource.cs
- ImageEditor.cs
- DelegateSerializationHolder.cs
- WindowsButton.cs
- AlternateViewCollection.cs
- FilterQuery.cs
- XmlBaseReader.cs
- ping.cs
- NotCondition.cs
- HttpResponseHeader.cs
- BaseCollection.cs
- Matrix3DConverter.cs
- ToolStripPanelRow.cs
- DirectoryGroupQuery.cs
- GenerateHelper.cs
- AutomationInteropProvider.cs
- PersonalizationAdministration.cs
- XamlGridLengthSerializer.cs
- String.cs
- AnnotationResourceCollection.cs
- DbgUtil.cs
- ElementUtil.cs
- XmlTextAttribute.cs
- WebProxyScriptElement.cs
- IdentityHolder.cs
- FixedSOMFixedBlock.cs
- AccessorTable.cs
- XmlDocumentType.cs
- TagPrefixAttribute.cs
- InstanceKeyCompleteException.cs
- ContextStack.cs
- ToolStripItemRenderEventArgs.cs
- TableAutomationPeer.cs
- XmlDataImplementation.cs
- Section.cs
- CodeCompileUnit.cs
- NavigationProperty.cs
- WhereQueryOperator.cs
- SqlWriter.cs
- DataTablePropertyDescriptor.cs
- CodeGotoStatement.cs
- IdentityReference.cs
- GlyphElement.cs
- FillErrorEventArgs.cs
- EdmFunction.cs
- BooleanSwitch.cs
- UnsafeNativeMethods.cs
- FontStretches.cs
- CredentialCache.cs
- SectionInformation.cs
- SplitterCancelEvent.cs
- SmtpFailedRecipientsException.cs
- TextSegment.cs
- FlowDocumentReaderAutomationPeer.cs
- FilterElement.cs
- WebContentFormatHelper.cs
- RuleAttributes.cs
- ToolStripManager.cs
- AuthenticationServiceManager.cs
- EmptyEnumerator.cs
- XmlCompatibilityReader.cs
- Compiler.cs
- CopyEncoder.cs
- ListViewDeleteEventArgs.cs
- WinEventTracker.cs
- CommandEventArgs.cs
- Stack.cs
- StandardBindingImporter.cs