Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / FrameworkContentElementAutomationPeer.cs / 1305600 / 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 labelPeer; } } } // 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 labelPeer; } } } // 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
- VirtualPath.cs
- TranslateTransform.cs
- DebuggerAttributes.cs
- RoleManagerModule.cs
- AxImporter.cs
- ETagAttribute.cs
- CrossContextChannel.cs
- MouseGestureConverter.cs
- GridViewCancelEditEventArgs.cs
- SqlGenericUtil.cs
- XPathEmptyIterator.cs
- StaticExtensionConverter.cs
- UrlMappingsModule.cs
- ListViewUpdateEventArgs.cs
- COMException.cs
- SchemaComplexType.cs
- DataObjectFieldAttribute.cs
- ImageMetadata.cs
- DesignerVerbCollection.cs
- ConnectionsZone.cs
- RowUpdatedEventArgs.cs
- InputScopeConverter.cs
- DbProviderServices.cs
- CommandCollectionEditor.cs
- TypedTableHandler.cs
- Group.cs
- RadioButtonList.cs
- LifetimeServices.cs
- ComponentDispatcher.cs
- SqlTopReducer.cs
- RepeaterItem.cs
- ListQueryResults.cs
- InputLanguageProfileNotifySink.cs
- GacUtil.cs
- AsymmetricKeyExchangeFormatter.cs
- FormView.cs
- TextTreeRootTextBlock.cs
- PageThemeParser.cs
- FileDialogCustomPlace.cs
- RemotingServices.cs
- ManagementObjectCollection.cs
- securitymgrsite.cs
- VarInfo.cs
- DataKeyCollection.cs
- InputLanguageCollection.cs
- ISAPIRuntime.cs
- DiscardableAttribute.cs
- DataServiceHost.cs
- GorillaCodec.cs
- StructuredProperty.cs
- FixedDocumentPaginator.cs
- WebExceptionStatus.cs
- ConfigXmlReader.cs
- OverrideMode.cs
- ConfigurationLocation.cs
- RtfToXamlLexer.cs
- HMACSHA1.cs
- ToolStripItemRenderEventArgs.cs
- FlowDocument.cs
- PenThreadWorker.cs
- ChtmlMobileTextWriter.cs
- ConversionContext.cs
- ClientRequest.cs
- WorkflowDesignerMessageFilter.cs
- ValidatingReaderNodeData.cs
- Slider.cs
- FaultReasonText.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SystemUnicastIPAddressInformation.cs
- ReaderWriterLock.cs
- PropertyChangingEventArgs.cs
- SerializationObjectManager.cs
- ImageSourceValueSerializer.cs
- DuplicateContext.cs
- TransactionScope.cs
- ButtonStandardAdapter.cs
- CodeSnippetCompileUnit.cs
- DeclaredTypeValidatorAttribute.cs
- EntitySqlQueryBuilder.cs
- IdentityValidationException.cs
- ButtonChrome.cs
- UseLicense.cs
- PropertyPathConverter.cs
- ClientScriptManagerWrapper.cs
- NonVisualControlAttribute.cs
- ExpressionPrefixAttribute.cs
- ToolStripSplitStackLayout.cs
- ConvertersCollection.cs
- LogEntryDeserializer.cs
- BitmapImage.cs
- AdapterDictionary.cs
- TypeAccessException.cs
- DataListComponentEditor.cs
- ConnectionPoolManager.cs
- ExplicitDiscriminatorMap.cs
- SamlDelegatingWriter.cs
- PngBitmapDecoder.cs
- Walker.cs
- Binding.cs
- WindowManager.cs