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
- XamlClipboardData.cs
- SqlAggregateChecker.cs
- ClientScriptManager.cs
- Quad.cs
- WindowsListViewGroupHelper.cs
- HtmlDocument.cs
- HttpProfileGroupBase.cs
- Menu.cs
- WrappedOptions.cs
- ScrollEventArgs.cs
- ToolBar.cs
- AxWrapperGen.cs
- ResourceProviderFactory.cs
- CheckBox.cs
- TextBlock.cs
- Substitution.cs
- Parsers.cs
- PeerApplicationLaunchInfo.cs
- SR.Designer.cs
- SQLRoleProvider.cs
- ExtentJoinTreeNode.cs
- CodeDelegateInvokeExpression.cs
- Exceptions.cs
- ErrorFormatterPage.cs
- FreezableCollection.cs
- AttributeUsageAttribute.cs
- ObjectKeyFrameCollection.cs
- NonVisualControlAttribute.cs
- DataGridViewCellPaintingEventArgs.cs
- IntPtr.cs
- OracleException.cs
- RuntimeConfigLKG.cs
- SystemIPAddressInformation.cs
- CommonDialog.cs
- MatrixTransform3D.cs
- ConstraintStruct.cs
- UserNameSecurityToken.cs
- ReadOnlyDictionary.cs
- ThousandthOfEmRealPoints.cs
- UpdateEventArgs.cs
- LinqMaximalSubtreeNominator.cs
- HostingPreferredMapPath.cs
- CannotUnloadAppDomainException.cs
- ILGenerator.cs
- UseLicense.cs
- BaseTemplateBuildProvider.cs
- sqlmetadatafactory.cs
- Crc32.cs
- FontFamily.cs
- ProgressBarAutomationPeer.cs
- MsmqChannelFactoryBase.cs
- FixedSOMGroup.cs
- TypeElement.cs
- BinaryKeyIdentifierClause.cs
- DataBoundControlParameterTarget.cs
- GlobalizationAssembly.cs
- DataGrid.cs
- TransformerTypeCollection.cs
- EntityDescriptor.cs
- Int16AnimationBase.cs
- GrammarBuilderWildcard.cs
- EditorZoneBase.cs
- UTF8Encoding.cs
- PcmConverter.cs
- WmpBitmapEncoder.cs
- XhtmlBasicControlAdapter.cs
- DataGridPageChangedEventArgs.cs
- CodeThrowExceptionStatement.cs
- OdbcStatementHandle.cs
- MethodRental.cs
- ListControl.cs
- TextSelection.cs
- PackageStore.cs
- AuthenticationModuleElement.cs
- DesignerLabelAdapter.cs
- ConversionValidationRule.cs
- PriorityChain.cs
- PropertyStore.cs
- Hex.cs
- RelatedEnd.cs
- CallId.cs
- FactoryGenerator.cs
- _MultipleConnectAsync.cs
- SHA384Managed.cs
- WinEventHandler.cs
- PointConverter.cs
- ChangePassword.cs
- SvcMapFileLoader.cs
- Expression.cs
- BindingExpressionBase.cs
- XPathDocument.cs
- CompilerResults.cs
- _KerberosClient.cs
- CommonDialog.cs
- ToolStripComboBox.cs
- ClientSettingsStore.cs
- ReadOnlyDataSource.cs
- X509Extension.cs
- DbConnectionPoolGroup.cs
- File.cs