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
- DefaultValueAttribute.cs
- Convert.cs
- RootBrowserWindowProxy.cs
- _HeaderInfo.cs
- ConcurrentDictionary.cs
- HtmlEncodedRawTextWriter.cs
- PageBuildProvider.cs
- DictionaryItemsCollection.cs
- VirtualPath.cs
- DbDataSourceEnumerator.cs
- ImageKeyConverter.cs
- CriticalHandle.cs
- FixedSOMTextRun.cs
- SharedStream.cs
- entityreference_tresulttype.cs
- MediaPlayer.cs
- XmlRawWriter.cs
- HandlerWithFactory.cs
- NonVisualControlAttribute.cs
- Size3DValueSerializer.cs
- InkCanvasFeedbackAdorner.cs
- WSDualHttpSecurityMode.cs
- SecurityUtils.cs
- StaticExtension.cs
- ToReply.cs
- BamlLocalizableResourceKey.cs
- PeerCollaboration.cs
- WebSysDefaultValueAttribute.cs
- ImageInfo.cs
- LocalizationComments.cs
- XsltConvert.cs
- Range.cs
- SystemTcpConnection.cs
- MessageQueueException.cs
- GridViewAutomationPeer.cs
- ConfigurationManagerHelper.cs
- BrowserCapabilitiesFactoryBase.cs
- RightsManagementSuppressedStream.cs
- CommandLibraryHelper.cs
- CollectionEditor.cs
- PasswordBox.cs
- CqlErrorHelper.cs
- TripleDESCryptoServiceProvider.cs
- BinaryWriter.cs
- GridPatternIdentifiers.cs
- ToggleButtonAutomationPeer.cs
- InputScope.cs
- WinCategoryAttribute.cs
- AnnotationResourceCollection.cs
- QualifiedCellIdBoolean.cs
- ExceptionHandler.cs
- PeerApplicationLaunchInfo.cs
- DropDownButton.cs
- Int32Rect.cs
- IisTraceListener.cs
- ToolbarAUtomationPeer.cs
- IncrementalCompileAnalyzer.cs
- XslCompiledTransform.cs
- ScopeCompiler.cs
- ToolStripDropTargetManager.cs
- TextFormatterHost.cs
- PreviousTrackingServiceAttribute.cs
- PerformanceCounterCategory.cs
- RightsManagementEncryptionTransform.cs
- Int32.cs
- Queue.cs
- CqlErrorHelper.cs
- CodeGeneratorOptions.cs
- ELinqQueryState.cs
- ProcessModule.cs
- DataColumn.cs
- InvalidCastException.cs
- TextViewSelectionProcessor.cs
- SqlClientFactory.cs
- XmlArrayAttribute.cs
- DesignerSerializationOptionsAttribute.cs
- LockedHandleGlyph.cs
- InputLanguageEventArgs.cs
- RepeaterItem.cs
- DBNull.cs
- CreateRefExpr.cs
- WebSysDisplayNameAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- WindowsFormsSectionHandler.cs
- DependencyPropertyKind.cs
- PrintControllerWithStatusDialog.cs
- BuildProvidersCompiler.cs
- ManagementOperationWatcher.cs
- TextDecorationUnitValidation.cs
- ValidationErrorEventArgs.cs
- dbdatarecord.cs
- SqlMethods.cs
- DesignerLinkAdapter.cs
- DataGridRow.cs
- XhtmlConformanceSection.cs
- XmlILIndex.cs
- TextFormatter.cs
- ExpressionBindingsDialog.cs
- BinaryCommonClasses.cs
- SqlStream.cs