Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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 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
- ObjectSecurity.cs
- DataStreams.cs
- FilterException.cs
- EncoderParameters.cs
- oledbmetadatacolumnnames.cs
- COM2ExtendedUITypeEditor.cs
- PreservationFileWriter.cs
- Bits.cs
- HttpDebugHandler.cs
- XmlSchemaImporter.cs
- TargetException.cs
- XmlILStorageConverter.cs
- WebPartMovingEventArgs.cs
- ProviderCollection.cs
- PersistStreamTypeWrapper.cs
- EventSinkActivityDesigner.cs
- InvokePatternIdentifiers.cs
- XPathDocumentIterator.cs
- GridView.cs
- Encoding.cs
- Rfc2898DeriveBytes.cs
- SharedUtils.cs
- SoapCommonClasses.cs
- PixelShader.cs
- CallContext.cs
- OleCmdHelper.cs
- EntityConnectionStringBuilder.cs
- RectangleHotSpot.cs
- FontStyles.cs
- mediaeventshelper.cs
- DecimalAnimationUsingKeyFrames.cs
- MembershipUser.cs
- KeyToListMap.cs
- LinearGradientBrush.cs
- CollaborationHelperFunctions.cs
- AutomationPeer.cs
- DataMember.cs
- CompoundFileDeflateTransform.cs
- HelloMessageCD1.cs
- TextFormatterHost.cs
- HostProtectionPermission.cs
- HtmlTextViewAdapter.cs
- InkCanvasFeedbackAdorner.cs
- SoapIgnoreAttribute.cs
- XPathNodeList.cs
- XmlSchemaSimpleTypeList.cs
- _HTTPDateParse.cs
- CommandLibraryHelper.cs
- AttachmentService.cs
- FormParameter.cs
- sqlstateclientmanager.cs
- PersonalizationStateQuery.cs
- ItemsPresenter.cs
- DbSetClause.cs
- Socket.cs
- AttachInfo.cs
- ModelItemExtensions.cs
- TypedRowHandler.cs
- IssuerInformation.cs
- TypeConvertions.cs
- EmptyControlCollection.cs
- KeyInterop.cs
- StringConverter.cs
- ProfileBuildProvider.cs
- DomainConstraint.cs
- WmiEventSink.cs
- Conditional.cs
- AttachedProperty.cs
- odbcmetadatacollectionnames.cs
- DSASignatureFormatter.cs
- SamlSerializer.cs
- DataPointer.cs
- InternalUserCancelledException.cs
- SystemIPGlobalProperties.cs
- MULTI_QI.cs
- EndOfStreamException.cs
- XmlTextReader.cs
- RegexGroupCollection.cs
- ProcessHostMapPath.cs
- WebDisplayNameAttribute.cs
- PaintValueEventArgs.cs
- AttachedPropertyBrowsableAttribute.cs
- ReadWriteObjectLock.cs
- BitmapEffectDrawingContextWalker.cs
- XmlCDATASection.cs
- CanonicalFontFamilyReference.cs
- CallInfo.cs
- DetailsViewInsertedEventArgs.cs
- HtmlInputPassword.cs
- XMLSchema.cs
- LicenseProviderAttribute.cs
- CacheDependency.cs
- ServiceOperationParameter.cs
- KeyEvent.cs
- PrimitiveType.cs
- WasAdminWrapper.cs
- DiscoveryServiceExtension.cs
- ResourceAssociationSetEnd.cs
- ImageBrush.cs
- SyndicationFeedFormatter.cs