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
- AttributeCollection.cs
- DetailsViewRowCollection.cs
- httpserverutility.cs
- CompatibleComparer.cs
- WebPartHelpVerb.cs
- CompiledQueryCacheEntry.cs
- CodeNamespace.cs
- AdapterSwitches.cs
- documentsequencetextview.cs
- IdentityReference.cs
- DataObjectMethodAttribute.cs
- RawUIStateInputReport.cs
- PrintingPermission.cs
- MetadataArtifactLoaderComposite.cs
- ArrayTypeMismatchException.cs
- ScriptingProfileServiceSection.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- DESCryptoServiceProvider.cs
- XPathNavigatorKeyComparer.cs
- DataPagerFieldItem.cs
- Win32Exception.cs
- ObjectDataSource.cs
- TraceLevelStore.cs
- CopyOnWriteList.cs
- ExpressionBindings.cs
- GPPOINTF.cs
- XmlAttributeProperties.cs
- ArgumentDesigner.xaml.cs
- ListDictionaryInternal.cs
- MatrixValueSerializer.cs
- PresentationAppDomainManager.cs
- StateBag.cs
- TraceSection.cs
- MailWebEventProvider.cs
- PackageProperties.cs
- DrawingBrush.cs
- XmlSerializationReader.cs
- TypeElement.cs
- Paragraph.cs
- PermissionSetTriple.cs
- FileDialogCustomPlace.cs
- RuntimeConfig.cs
- MetabaseReader.cs
- DragEventArgs.cs
- DataBindingList.cs
- XmlNamespaceMapping.cs
- SchemaHelper.cs
- CommandEventArgs.cs
- BindableTemplateBuilder.cs
- Soap11ServerProtocol.cs
- WindowsClaimSet.cs
- XhtmlBasicCommandAdapter.cs
- mediapermission.cs
- DtrList.cs
- XAMLParseException.cs
- PaintEvent.cs
- MultipleViewPatternIdentifiers.cs
- StackBuilderSink.cs
- RowToFieldTransformer.cs
- TargetConverter.cs
- CodeCommentStatement.cs
- XmlNodeChangedEventManager.cs
- ConnectionOrientedTransportElement.cs
- ContractInferenceHelper.cs
- StorageMappingItemCollection.cs
- ArrayTypeMismatchException.cs
- ItemCheckedEvent.cs
- SinglePageViewer.cs
- MobileControlBuilder.cs
- WindowInteractionStateTracker.cs
- PropertyEntry.cs
- AssociationEndMember.cs
- PolyBezierSegment.cs
- ADConnectionHelper.cs
- GenericEnumerator.cs
- SqlMethods.cs
- DbConnectionPoolGroup.cs
- activationcontext.cs
- LicFileLicenseProvider.cs
- DataAdapter.cs
- HasActivatableWorkflowEvent.cs
- InheritedPropertyChangedEventArgs.cs
- CodeTypeDeclaration.cs
- SqlParameter.cs
- ZipIOModeEnforcingStream.cs
- ResourcesChangeInfo.cs
- MenuItem.cs
- StylusLogic.cs
- Range.cs
- NamespaceListProperty.cs
- RowVisual.cs
- RepeaterItemEventArgs.cs
- ListItemParagraph.cs
- ArglessEventHandlerProxy.cs
- HttpResponseBase.cs
- UnsafePeerToPeerMethods.cs
- DataGridTextBox.cs
- PageParser.cs
- ListItem.cs
- _BasicClient.cs