Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / FrameworkContentElementAutomationPeer.cs / 2 / 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
- ClientTargetCollection.cs
- Geometry3D.cs
- CookieProtection.cs
- _DigestClient.cs
- SoapFault.cs
- PropertyChangeTracker.cs
- activationcontext.cs
- RotationValidation.cs
- sqlstateclientmanager.cs
- FormConverter.cs
- KnowledgeBase.cs
- UnsupportedPolicyOptionsException.cs
- Graphics.cs
- LinearGradientBrush.cs
- NavigationPropertyEmitter.cs
- ListQueryResults.cs
- ToolStripPanelRenderEventArgs.cs
- RuntimeArgumentHandle.cs
- XmlUtil.cs
- XmlMembersMapping.cs
- VerticalAlignConverter.cs
- DynamicMetaObject.cs
- OracleException.cs
- MailAddressCollection.cs
- PersistenceProviderBehavior.cs
- CaseStatement.cs
- FormParameter.cs
- ConstraintConverter.cs
- CreateUserWizardStep.cs
- FormDesigner.cs
- ProfileParameter.cs
- StartUpEventArgs.cs
- SpecialFolderEnumConverter.cs
- DataConnectionHelper.cs
- MarkupCompilePass2.cs
- GuidelineCollection.cs
- ImageListStreamer.cs
- Duration.cs
- ArrayListCollectionBase.cs
- RbTree.cs
- PublisherIdentityPermission.cs
- WpfWebRequestHelper.cs
- XmlChildNodes.cs
- EntityCommandExecutionException.cs
- FileLoadException.cs
- XmlDataSourceDesigner.cs
- Duration.cs
- ServerValidateEventArgs.cs
- CodeArgumentReferenceExpression.cs
- GenericAuthenticationEventArgs.cs
- UIElement3DAutomationPeer.cs
- ImageMetadata.cs
- IsolatedStorageFileStream.cs
- IIS7WorkerRequest.cs
- HMACSHA1.cs
- MdbDataFileEditor.cs
- KernelTypeValidation.cs
- Button.cs
- TextCharacters.cs
- RuntimeHandles.cs
- ISFClipboardData.cs
- SystemUnicastIPAddressInformation.cs
- XslVisitor.cs
- WebPartMovingEventArgs.cs
- FlowDocumentReaderAutomationPeer.cs
- DependencyPropertyConverter.cs
- GenericsNotImplementedException.cs
- ComponentDesigner.cs
- Configuration.cs
- WeakKeyDictionary.cs
- SafeNativeMethods.cs
- CodeBlockBuilder.cs
- SeverityFilter.cs
- GradientSpreadMethodValidation.cs
- Options.cs
- FixedSOMPage.cs
- ProjectionPathBuilder.cs
- RadioButton.cs
- EventProxy.cs
- AnchorEditor.cs
- MouseButtonEventArgs.cs
- ControlPropertyNameConverter.cs
- BuilderInfo.cs
- VirtualizingStackPanel.cs
- EntityDataSourceChangingEventArgs.cs
- DbConnectionPoolGroupProviderInfo.cs
- ObjectQueryProvider.cs
- ObjectSet.cs
- XmlUTF8TextReader.cs
- _ContextAwareResult.cs
- EdmComplexPropertyAttribute.cs
- ConfigXmlSignificantWhitespace.cs
- DataBindingHandlerAttribute.cs
- CodeExpressionRuleDeclaration.cs
- InstanceLockedException.cs
- MetadataCacheItem.cs
- ProcessHostConfigUtils.cs
- TypeInfo.cs
- XmlArrayItemAttribute.cs
- SeekStoryboard.cs