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
- ScrollChrome.cs
- SiteMapProvider.cs
- MemoryMappedViewStream.cs
- RotateTransform.cs
- ZipIOFileItemStream.cs
- RangeValuePatternIdentifiers.cs
- Drawing.cs
- ParseHttpDate.cs
- NullableDoubleMinMaxAggregationOperator.cs
- _DynamicWinsockMethods.cs
- SessionIDManager.cs
- MimeTextImporter.cs
- RenderDataDrawingContext.cs
- RightsManagementManager.cs
- DragEvent.cs
- DockPattern.cs
- SQLDateTime.cs
- XPathNodePointer.cs
- SByte.cs
- DbModificationClause.cs
- RequestQueue.cs
- Operand.cs
- RawStylusInputCustomDataList.cs
- ResXResourceSet.cs
- ConfigurationManager.cs
- ActivityDelegate.cs
- UIPermission.cs
- SmiEventSink_DeferedProcessing.cs
- ProfileGroupSettingsCollection.cs
- Triangle.cs
- RuntimeEnvironment.cs
- VirtualPath.cs
- SafeFileMappingHandle.cs
- DbMetaDataFactory.cs
- XmlDomTextWriter.cs
- MapPathBasedVirtualPathProvider.cs
- ClientSession.cs
- TimeoutException.cs
- RowType.cs
- Pen.cs
- DataControlCommands.cs
- BinaryQueryOperator.cs
- ResourceDefaultValueAttribute.cs
- ComponentEditorForm.cs
- ResourceAssociationTypeEnd.cs
- ImageDrawing.cs
- Inline.cs
- TypeDependencyAttribute.cs
- COAUTHINFO.cs
- DmlSqlGenerator.cs
- DataControlImageButton.cs
- QueueNameHelper.cs
- ComplexObject.cs
- diagnosticsswitches.cs
- ResponseStream.cs
- ObjectCache.cs
- GetChildSubtree.cs
- RoleService.cs
- PipelineModuleStepContainer.cs
- XmlReflectionImporter.cs
- RepeatEnumerable.cs
- SpecialNameAttribute.cs
- SafeFileHandle.cs
- SimpleType.cs
- Boolean.cs
- ISessionStateStore.cs
- HttpConfigurationContext.cs
- WCFModelStrings.Designer.cs
- Expression.cs
- SqlBinder.cs
- ResourceWriter.cs
- PersonalizableAttribute.cs
- TextPatternIdentifiers.cs
- TraceEventCache.cs
- Rule.cs
- Point4D.cs
- SafeRightsManagementPubHandle.cs
- FontWeights.cs
- ObjectDataSourceMethodEventArgs.cs
- JsonServiceDocumentSerializer.cs
- DataServiceHostFactory.cs
- MailBnfHelper.cs
- RtType.cs
- SchemaCollectionCompiler.cs
- AppSettingsExpressionBuilder.cs
- ExpressionTextBoxAutomationPeer.cs
- StructuredTypeInfo.cs
- GenericEnumConverter.cs
- VariantWrapper.cs
- ExpressionVisitorHelpers.cs
- SoundPlayer.cs
- PlatformCulture.cs
- Pkcs7Signer.cs
- CodeDomSerializerBase.cs
- EdmSchemaError.cs
- SineEase.cs
- EntityUtil.cs
- SerializationAttributes.cs
- CodeMethodReturnStatement.cs
- NetworkInformationPermission.cs