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
- ApplicationId.cs
- DocumentGridContextMenu.cs
- TableRowCollection.cs
- ConfigurationProviderException.cs
- GeneralEndpointIdentity.cs
- BaseCodeDomTreeGenerator.cs
- oledbmetadatacollectionnames.cs
- BinaryObjectInfo.cs
- TraceHandlerErrorFormatter.cs
- AnimationStorage.cs
- ZoomPercentageConverter.cs
- SafeUserTokenHandle.cs
- MatrixTransform.cs
- RequiredFieldValidator.cs
- Condition.cs
- BrowserCapabilitiesFactoryBase.cs
- InputScope.cs
- SecureUICommand.cs
- GeneralTransform3D.cs
- DependencyPropertyValueSerializer.cs
- ExtendedTransformFactory.cs
- DataGridViewRowHeaderCell.cs
- ListViewDesigner.cs
- BaseCollection.cs
- MaterialCollection.cs
- X509Chain.cs
- MessageDesigner.cs
- LinearKeyFrames.cs
- URIFormatException.cs
- PartialList.cs
- HtmlElementErrorEventArgs.cs
- OptimizerPatterns.cs
- BamlWriter.cs
- InitializationEventAttribute.cs
- DataGridViewCellPaintingEventArgs.cs
- VarInfo.cs
- PixelFormat.cs
- Wildcard.cs
- VectorKeyFrameCollection.cs
- SHA384Managed.cs
- BamlBinaryReader.cs
- CompositeFontInfo.cs
- BaseCAMarshaler.cs
- TreeNodeBindingCollection.cs
- SqlCacheDependencySection.cs
- XNodeSchemaApplier.cs
- WebPartsPersonalization.cs
- RuntimeConfig.cs
- CompilationUtil.cs
- MimeReflector.cs
- SqlTrackingQuery.cs
- StaticTextPointer.cs
- StylusCaptureWithinProperty.cs
- PageAsyncTask.cs
- SubpageParagraph.cs
- DataRow.cs
- SafeCryptoHandles.cs
- Internal.cs
- XmlComment.cs
- CultureSpecificCharacterBufferRange.cs
- WebContext.cs
- AstNode.cs
- DataServiceRequestArgs.cs
- SuppressIldasmAttribute.cs
- XmlStreamStore.cs
- AssemblyAttributesGoHere.cs
- MetadataConversionError.cs
- SerializableAttribute.cs
- FontStretch.cs
- Panel.cs
- PerformanceCounter.cs
- PreProcessInputEventArgs.cs
- VisualStyleInformation.cs
- SqlDataSourceCustomCommandEditor.cs
- DictionaryItemsCollection.cs
- Environment.cs
- OleDbDataReader.cs
- RadioButtonBaseAdapter.cs
- NameValueSectionHandler.cs
- ListArgumentProvider.cs
- DropDownButton.cs
- DataControlFieldHeaderCell.cs
- ProgramNode.cs
- DashStyle.cs
- NavigationExpr.cs
- StructuredType.cs
- Int16Storage.cs
- UmAlQuraCalendar.cs
- ExpandSegmentCollection.cs
- GraphicsPath.cs
- altserialization.cs
- FastEncoder.cs
- COAUTHIDENTITY.cs
- SpoolingTaskBase.cs
- ProcessInfo.cs
- DNS.cs
- ParallelRangeManager.cs
- PathStreamGeometryContext.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- LayoutTableCell.cs