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
- Expression.cs
- MessageFormatterConverter.cs
- FunctionUpdateCommand.cs
- RegistryKey.cs
- BamlTreeNode.cs
- RelatedPropertyManager.cs
- ImageButton.cs
- ExpandSegment.cs
- XmlConvert.cs
- RequestSecurityToken.cs
- AppSecurityManager.cs
- DataGridViewImageColumn.cs
- WebPartCatalogAddVerb.cs
- SizeAnimation.cs
- XsltArgumentList.cs
- FormsAuthenticationTicket.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DynamicRendererThreadManager.cs
- StrongNameIdentityPermission.cs
- X509UI.cs
- WebPartAuthorizationEventArgs.cs
- OleDbTransaction.cs
- SubstitutionList.cs
- CompiledQuery.cs
- StylusButtonCollection.cs
- ColorContext.cs
- ObjectListFieldsPage.cs
- ActionItem.cs
- BookmarkEventArgs.cs
- FreezableOperations.cs
- Matrix3DStack.cs
- SystemSounds.cs
- DbParameterCollectionHelper.cs
- DateTimePicker.cs
- TypeDelegator.cs
- VirtualPathProvider.cs
- InstancePersistence.cs
- BuiltInExpr.cs
- FileLoadException.cs
- TableLayoutCellPaintEventArgs.cs
- XmlComplianceUtil.cs
- MsmqChannelFactoryBase.cs
- AmbiguousMatchException.cs
- PropertyExpression.cs
- GetLastErrorDetailsRequest.cs
- DataTableMappingCollection.cs
- StateMachineWorkflowInstance.cs
- PolyLineSegment.cs
- DataGridViewRowCollection.cs
- TextPointer.cs
- ContextMenuStrip.cs
- FrameworkContentElement.cs
- ToolStripComboBox.cs
- Stack.cs
- HttpContext.cs
- RtType.cs
- SafeNativeMethodsOther.cs
- SqlDataSourceSelectingEventArgs.cs
- BookmarkUndoUnit.cs
- VariableQuery.cs
- GACMembershipCondition.cs
- Cursor.cs
- IgnorePropertiesAttribute.cs
- TableAdapterManagerHelper.cs
- UIPropertyMetadata.cs
- CancelEventArgs.cs
- LockedAssemblyCache.cs
- StoreContentChangedEventArgs.cs
- BaseCodeDomTreeGenerator.cs
- RoleGroupCollection.cs
- SymbolEqualComparer.cs
- WindowPatternIdentifiers.cs
- XPathScanner.cs
- CustomErrorsSectionWrapper.cs
- PathTooLongException.cs
- CompilerTypeWithParams.cs
- PenContexts.cs
- DataPointer.cs
- RefExpr.cs
- GlobalProxySelection.cs
- _AutoWebProxyScriptWrapper.cs
- SafeViewOfFileHandle.cs
- HostAdapter.cs
- SingleSelectRootGridEntry.cs
- CodeFieldReferenceExpression.cs
- DefaultCommandConverter.cs
- WebPartConnectionsCancelVerb.cs
- Utils.cs
- GeneralTransform.cs
- OperandQuery.cs
- AccessorTable.cs
- LogLogRecord.cs
- KeyedCollection.cs
- StandardCommands.cs
- HttpRawResponse.cs
- XmlNamespaceManager.cs
- StringSource.cs
- UnsafeNativeMethods.cs
- IriParsingElement.cs
- EqualityComparer.cs