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
- HtmlGenericControl.cs
- ComplexBindingPropertiesAttribute.cs
- TimelineGroup.cs
- Rules.cs
- SystemIPInterfaceStatistics.cs
- XmlDataProvider.cs
- MatrixTransform.cs
- SqlBooleanizer.cs
- ConfigurationSettings.cs
- VectorCollection.cs
- QilReplaceVisitor.cs
- AppDomainGrammarProxy.cs
- PageStatePersister.cs
- ThreadAttributes.cs
- ReflectPropertyDescriptor.cs
- QuaternionRotation3D.cs
- ZipIOExtraFieldZip64Element.cs
- ThaiBuddhistCalendar.cs
- QilFactory.cs
- WebSysDescriptionAttribute.cs
- PrePostDescendentsWalker.cs
- DataTableTypeConverter.cs
- BasicAsyncResult.cs
- ControlBuilderAttribute.cs
- SerialPinChanges.cs
- AccessDataSourceView.cs
- BreakRecordTable.cs
- XsltContext.cs
- InputBinding.cs
- TabPage.cs
- FieldAccessException.cs
- HtmlHead.cs
- RsaSecurityTokenParameters.cs
- SystemIPInterfaceProperties.cs
- RequestResponse.cs
- MetadataCollection.cs
- ContextQuery.cs
- OpenTypeCommon.cs
- DirectoryNotFoundException.cs
- HistoryEventArgs.cs
- RelationshipType.cs
- QuotedPairReader.cs
- UpdateTranslator.cs
- SqlMethodCallConverter.cs
- BrowserCapabilitiesFactory.cs
- ProtectedConfigurationSection.cs
- BindingWorker.cs
- TypeContext.cs
- VBIdentifierName.cs
- EnumerableValidator.cs
- SqlFormatter.cs
- DispatcherHookEventArgs.cs
- NullableConverter.cs
- MsmqBindingMonitor.cs
- ProcessModelSection.cs
- RadioButtonRenderer.cs
- ThreadExceptionEvent.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ToolStripStatusLabel.cs
- HwndProxyElementProvider.cs
- DataGridViewImageCell.cs
- NetworkInformationException.cs
- RuleInfoComparer.cs
- CssStyleCollection.cs
- ToolStripDropTargetManager.cs
- DataRowChangeEvent.cs
- Int16AnimationBase.cs
- VScrollBar.cs
- XMLSyntaxException.cs
- XmlDataSource.cs
- ScriptModule.cs
- MenuItemBinding.cs
- ProjectedSlot.cs
- BitmapEffectvisualstate.cs
- WebControlAdapter.cs
- BindingListCollectionView.cs
- CultureSpecificStringDictionary.cs
- ResourceCodeDomSerializer.cs
- Soap11ServerProtocol.cs
- ProxyHelper.cs
- DataStreams.cs
- IIS7UserPrincipal.cs
- EnglishPluralizationService.cs
- UnsafeNativeMethods.cs
- _NegotiateClient.cs
- EventMappingSettings.cs
- MSAANativeProvider.cs
- SharedConnectionListener.cs
- Config.cs
- CodeEntryPointMethod.cs
- RectangleGeometry.cs
- ApplicationSettingsBase.cs
- CompilerParameters.cs
- AdornerLayer.cs
- CompositeDuplexElement.cs
- ObjectListField.cs
- DataGridViewTextBoxEditingControl.cs
- MsmqProcessProtocolHandler.cs
- RegistryKey.cs
- HostingEnvironmentSection.cs