Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Automation / Peers / FrameworkContentElementAutomationPeer.cs / 1 / 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 null; } } } // 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 null; } } } // 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
- DropDownButton.cs
- CodeVariableDeclarationStatement.cs
- SQLInt64Storage.cs
- LicenseException.cs
- NavigationProperty.cs
- MissingFieldException.cs
- XmlTypeMapping.cs
- XPathQilFactory.cs
- sortedlist.cs
- ThreadPool.cs
- CompositeActivityMarkupSerializer.cs
- Screen.cs
- SoapIgnoreAttribute.cs
- Compress.cs
- CompositeDesignerAccessibleObject.cs
- XamlHttpHandlerFactory.cs
- ListItem.cs
- RelationalExpressions.cs
- SqlDataSourceCommandEventArgs.cs
- Pen.cs
- Cursors.cs
- dbenumerator.cs
- FixedSOMTable.cs
- TextDecorationUnitValidation.cs
- MetadataSource.cs
- ObjectQueryExecutionPlan.cs
- XamlReader.cs
- Stackframe.cs
- HttpFileCollection.cs
- ContextCorrelationInitializer.cs
- _BufferOffsetSize.cs
- RenderDataDrawingContext.cs
- AsymmetricAlgorithm.cs
- RC2.cs
- SurrogateEncoder.cs
- KeyManager.cs
- Object.cs
- PeerCustomResolverSettings.cs
- MouseActionValueSerializer.cs
- TextElementCollectionHelper.cs
- PerformanceCounterManager.cs
- ServiceContractDetailViewControl.cs
- PrintDialogException.cs
- Vector3DCollectionConverter.cs
- SmtpFailedRecipientException.cs
- VisualCollection.cs
- StaticFileHandler.cs
- DiscoveryDocumentLinksPattern.cs
- WindowsFormsEditorServiceHelper.cs
- SafeFileHandle.cs
- RepeatButtonAutomationPeer.cs
- dbdatarecord.cs
- XmlEventCache.cs
- ReferentialConstraintRoleElement.cs
- CacheChildrenQuery.cs
- MyContact.cs
- AutomationPeer.cs
- NavigationCommands.cs
- RegexParser.cs
- GeometryHitTestParameters.cs
- xmlformatgeneratorstatics.cs
- DataGridLength.cs
- CustomPopupPlacement.cs
- WindowsStartMenu.cs
- EmptyEnumerator.cs
- GPStream.cs
- InkCollectionBehavior.cs
- CharEnumerator.cs
- DefaultEventAttribute.cs
- TextOnlyOutput.cs
- ConnectionProviderAttribute.cs
- LineServicesRun.cs
- DBParameter.cs
- DescriptionAttribute.cs
- TextUtf8RawTextWriter.cs
- ScrollViewerAutomationPeer.cs
- Knowncolors.cs
- BamlLocalizationDictionary.cs
- IODescriptionAttribute.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ValueUtilsSmi.cs
- InternalPermissions.cs
- TraceContextEventArgs.cs
- DataGridViewHitTestInfo.cs
- MailBnfHelper.cs
- TextParagraph.cs
- InvalidFilterCriteriaException.cs
- ControlIdConverter.cs
- DbConnectionPoolGroupProviderInfo.cs
- AppDomainManager.cs
- NaturalLanguageHyphenator.cs
- ProfileParameter.cs
- Point3DCollectionConverter.cs
- SmtpCommands.cs
- ValueChangedEventManager.cs
- Stroke2.cs
- TCPClient.cs
- HttpCachePolicy.cs
- Track.cs
- MdImport.cs