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 / LabelAutomationPeer.cs / 1 / LabelAutomationPeer.cs
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Windows;
using System.Windows.Automation.Provider;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using MS.Internal;
using MS.Win32;
namespace System.Windows.Automation.Peers
{
///
public class LabelAutomationPeer : FrameworkElementAutomationPeer
{
///
public LabelAutomationPeer(Label owner): base(owner)
{}
///
override protected string GetClassNameCore()
{
return "Text";
}
///
override protected AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Text;
}
///
override public object GetPattern(PatternInterface patternInterface)
{
return null;
}
// Return the base without the AccessKey character
///
override protected string GetNameCore()
{
string result = base.GetNameCore();
if (!string.IsNullOrEmpty(result))
{
Label label = (Label)Owner;
if (label.Content is string)
{
return AccessText.RemoveAccessKeyMarker(result);
}
}
return result;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Windows;
using System.Windows.Automation.Provider;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using MS.Internal;
using MS.Win32;
namespace System.Windows.Automation.Peers
{
///
public class LabelAutomationPeer : FrameworkElementAutomationPeer
{
///
public LabelAutomationPeer(Label owner): base(owner)
{}
///
override protected string GetClassNameCore()
{
return "Text";
}
///
override protected AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Text;
}
///
override public object GetPattern(PatternInterface patternInterface)
{
return null;
}
// Return the base without the AccessKey character
///
override protected string GetNameCore()
{
string result = base.GetNameCore();
if (!string.IsNullOrEmpty(result))
{
Label label = (Label)Owner;
if (label.Content is string)
{
return AccessText.RemoveAccessKeyMarker(result);
}
}
return result;
}
}
}
// 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
- objectquery_tresulttype.cs
- CheckPair.cs
- ObjectDataSourceView.cs
- CalendarAutomationPeer.cs
- SerializerProvider.cs
- DataControlCommands.cs
- VectorAnimationBase.cs
- CompiledIdentityConstraint.cs
- Rijndael.cs
- Maps.cs
- FormatStringEditor.cs
- XmlSerializationGeneratedCode.cs
- MouseActionValueSerializer.cs
- DBParameter.cs
- MappingMetadataHelper.cs
- QuaternionKeyFrameCollection.cs
- NavigatorInput.cs
- TransformGroup.cs
- TrackBarRenderer.cs
- WebPartTransformerAttribute.cs
- PassportAuthenticationModule.cs
- DiagnosticSection.cs
- WebExceptionStatus.cs
- DragDropHelper.cs
- MimeTypePropertyAttribute.cs
- QueryPageSettingsEventArgs.cs
- EntityKey.cs
- shaperfactoryquerycacheentry.cs
- CharacterMetricsDictionary.cs
- OdbcConnectionString.cs
- ContentElement.cs
- _FtpControlStream.cs
- FixedSOMSemanticBox.cs
- QueryCacheKey.cs
- ParameterCollectionEditorForm.cs
- TraceLog.cs
- DirectionalLight.cs
- __FastResourceComparer.cs
- ProxySimple.cs
- ScriptControl.cs
- JsonFormatReaderGenerator.cs
- NamespaceExpr.cs
- ObjectParameter.cs
- SHA384.cs
- LocalizationComments.cs
- DataGridViewCellStateChangedEventArgs.cs
- HtmlInputImage.cs
- XmlLanguage.cs
- ComboBoxItem.cs
- ObjectListField.cs
- QueuePathEditor.cs
- FixedFlowMap.cs
- HashCryptoHandle.cs
- XPathAxisIterator.cs
- DataGridViewCellLinkedList.cs
- DbConnectionPoolIdentity.cs
- DecimalStorage.cs
- DataSourceDescriptorCollection.cs
- XmlNotation.cs
- DataListItemCollection.cs
- AxisAngleRotation3D.cs
- ProjectedSlot.cs
- RichTextBoxConstants.cs
- LinkedResourceCollection.cs
- Token.cs
- FontInfo.cs
- SynchronizedDispatch.cs
- VirtualizedItemPattern.cs
- GridProviderWrapper.cs
- _HeaderInfo.cs
- AutoGeneratedField.cs
- XmlSortKeyAccumulator.cs
- XmlCharacterData.cs
- WebPartMenu.cs
- StateRuntime.cs
- WebScriptEnablingBehavior.cs
- OleCmdHelper.cs
- _PooledStream.cs
- PeerPresenceInfo.cs
- ConnectionManagementElement.cs
- DataGridViewComboBoxColumn.cs
- DelegateBodyWriter.cs
- HashSetDebugView.cs
- BinaryCommonClasses.cs
- TextEffect.cs
- GridLength.cs
- ToolStripDesigner.cs
- CommentEmitter.cs
- MapPathBasedVirtualPathProvider.cs
- HttpContext.cs
- BindingList.cs
- XmlEntityReference.cs
- PageParser.cs
- ManagementException.cs
- PersonalizationDictionary.cs
- DisplayNameAttribute.cs
- X509ServiceCertificateAuthentication.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- AttachmentService.cs
- SoundPlayerAction.cs