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
- ButtonColumn.cs
- AppDomainShutdownMonitor.cs
- SHA512.cs
- RequestCachingSection.cs
- TypedTableGenerator.cs
- ResizeBehavior.cs
- DataObjectFieldAttribute.cs
- ObjectSerializerFactory.cs
- PropertyGeneratedEventArgs.cs
- PkcsUtils.cs
- Delegate.cs
- Code.cs
- DataGridViewCellCancelEventArgs.cs
- WinFormsSpinner.cs
- InputMethodStateChangeEventArgs.cs
- DataSourceCache.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- LicenseManager.cs
- WebSysDisplayNameAttribute.cs
- BoolExpressionVisitors.cs
- HtmlHistory.cs
- SecurityDescriptor.cs
- ContextMenuStrip.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XmlDocumentSerializer.cs
- SelectionRange.cs
- OutOfMemoryException.cs
- SqlUnionizer.cs
- SerialErrors.cs
- InstanceNameConverter.cs
- TreeNodeBinding.cs
- Win32Exception.cs
- COM2Properties.cs
- ActivityCodeGenerator.cs
- HandleCollector.cs
- SEHException.cs
- SmiRecordBuffer.cs
- IItemProperties.cs
- InkCanvasFeedbackAdorner.cs
- COM2ExtendedTypeConverter.cs
- XmlAtomicValue.cs
- CipherData.cs
- SlipBehavior.cs
- Rotation3D.cs
- ImageBrush.cs
- ScriptControlManager.cs
- RequestQueryParser.cs
- RoleServiceManager.cs
- CacheSection.cs
- RestClientProxyHandler.cs
- SettingsPropertyIsReadOnlyException.cs
- MbpInfo.cs
- AsyncCompletedEventArgs.cs
- DashStyle.cs
- BamlStream.cs
- ExpressionReplacer.cs
- BitmapScalingModeValidation.cs
- CacheHelper.cs
- DictionaryGlobals.cs
- HuffModule.cs
- PermissionToken.cs
- ListControlConvertEventArgs.cs
- RadialGradientBrush.cs
- RegexNode.cs
- Misc.cs
- ExpressionBuilder.cs
- BasicViewGenerator.cs
- ZipIOExtraFieldElement.cs
- ColorTransformHelper.cs
- RangeValidator.cs
- TextBreakpoint.cs
- CharacterMetricsDictionary.cs
- SignatureResourcePool.cs
- BitmapEffectInput.cs
- ViewBase.cs
- SplineQuaternionKeyFrame.cs
- SqlGenericUtil.cs
- InvalidAsynchronousStateException.cs
- PassportAuthentication.cs
- SoapFault.cs
- ValidationResult.cs
- CodeSubDirectoriesCollection.cs
- Utility.cs
- TableParagraph.cs
- WebPartTransformerAttribute.cs
- SafeLibraryHandle.cs
- GridViewRowEventArgs.cs
- StylusEditingBehavior.cs
- XPathArrayIterator.cs
- XmlReader.cs
- FontWeights.cs
- GraphicsContext.cs
- BufferedReadStream.cs
- AutoGeneratedFieldProperties.cs
- Psha1DerivedKeyGeneratorHelper.cs
- QueuePathDialog.cs
- XmlHierarchicalEnumerable.cs
- ACE.cs
- XmlCDATASection.cs
- ColorInterpolationModeValidation.cs