Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / 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 // 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
- StylusPointProperties.cs
- DocumentGrid.cs
- odbcmetadatacollectionnames.cs
- ConsoleCancelEventArgs.cs
- DES.cs
- PerformanceCounterManager.cs
- FormViewPagerRow.cs
- ClientConvert.cs
- SafeCoTaskMem.cs
- WebEventTraceProvider.cs
- FocusWithinProperty.cs
- AssemblyCollection.cs
- SqlCacheDependencyDatabase.cs
- ClassHandlersStore.cs
- ConfigXmlCDataSection.cs
- EdmComplexPropertyAttribute.cs
- AnimatedTypeHelpers.cs
- BamlLocalizableResource.cs
- LineUtil.cs
- ComponentEditorForm.cs
- SmtpLoginAuthenticationModule.cs
- SpotLight.cs
- PropertyContainer.cs
- Geometry3D.cs
- WSHttpTransportSecurityElement.cs
- precedingsibling.cs
- XPathMultyIterator.cs
- RtType.cs
- Soap.cs
- ComplexLine.cs
- NavigationPropertyAccessor.cs
- SynchronizedDispatch.cs
- DecoderNLS.cs
- SafeCryptoHandles.cs
- CookielessData.cs
- IWorkflowDebuggerService.cs
- DefaultSerializationProviderAttribute.cs
- LogRestartAreaEnumerator.cs
- XamlGridLengthSerializer.cs
- _RequestLifetimeSetter.cs
- TransformationRules.cs
- XmlSchemaComplexContent.cs
- HtmlTableRow.cs
- AnyAllSearchOperator.cs
- NamespaceCollection.cs
- PolyQuadraticBezierSegment.cs
- DropDownButton.cs
- TranslateTransform3D.cs
- BrowserDefinition.cs
- FileSystemEventArgs.cs
- DbDataSourceEnumerator.cs
- EntityTypeEmitter.cs
- TypeInitializationException.cs
- WebPartZone.cs
- LazyTextWriterCreator.cs
- DataGridViewCellCancelEventArgs.cs
- BufferedGraphics.cs
- Operand.cs
- AssemblyFilter.cs
- WebServiceHost.cs
- RectIndependentAnimationStorage.cs
- ImageCodecInfo.cs
- X509CertificateChain.cs
- EnumConverter.cs
- MeasureData.cs
- ConstraintEnumerator.cs
- ListDataBindEventArgs.cs
- InternalConfigRoot.cs
- _ProxyRegBlob.cs
- AddInEnvironment.cs
- TrackBarRenderer.cs
- XmlNamedNodeMap.cs
- AppDomainProtocolHandler.cs
- TrackingDataItem.cs
- CollectionConverter.cs
- CacheForPrimitiveTypes.cs
- ServiceCredentialsSecurityTokenManager.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CssTextWriter.cs
- IPEndPoint.cs
- XmlSchemaAttribute.cs
- HwndSource.cs
- ContentElement.cs
- PrivateFontCollection.cs
- CompilerInfo.cs
- DataControlPagerLinkButton.cs
- Interlocked.cs
- PageHandlerFactory.cs
- ByteRangeDownloader.cs
- ProfilePropertyMetadata.cs
- QuaternionKeyFrameCollection.cs
- PreloadedPackages.cs
- ToolStripPanelRenderEventArgs.cs
- VectorCollectionConverter.cs
- Marshal.cs
- UserControlParser.cs
- WindowsListViewGroup.cs
- DelegateHelpers.Generated.cs
- Camera.cs
- DataChangedEventManager.cs