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
- WebPartTransformerAttribute.cs
- WinInetCache.cs
- DesignerActionItem.cs
- EdmComplexPropertyAttribute.cs
- XmlAttributeCollection.cs
- XAMLParseException.cs
- WindowsTokenRoleProvider.cs
- BindingList.cs
- PhoneCall.cs
- DescriptionAttribute.cs
- HtmlProps.cs
- TextEncodedRawTextWriter.cs
- RichTextBox.cs
- DataGridColumnCollection.cs
- MethodToken.cs
- MdImport.cs
- ContextMenu.cs
- PersianCalendar.cs
- DataStreams.cs
- GenericsInstances.cs
- ProxyAttribute.cs
- CodeCatchClause.cs
- NameScopePropertyAttribute.cs
- PixelShader.cs
- DataKey.cs
- ServiceContractDetailViewControl.cs
- ConfigurationStrings.cs
- InstanceDataCollection.cs
- CodeDomSerializerException.cs
- TimersDescriptionAttribute.cs
- versioninfo.cs
- PlanCompilerUtil.cs
- SrgsGrammarCompiler.cs
- XamlTemplateSerializer.cs
- ZipIOCentralDirectoryFileHeader.cs
- TableParagraph.cs
- InteropAutomationProvider.cs
- SingleConverter.cs
- MouseEventArgs.cs
- XmlSchemaParticle.cs
- ClonableStack.cs
- ExtendedProtectionPolicyTypeConverter.cs
- FontStretches.cs
- ContentValidator.cs
- ConfigurationLocationCollection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- LinqDataSourceUpdateEventArgs.cs
- CodeGroup.cs
- LostFocusEventManager.cs
- SoapIgnoreAttribute.cs
- CacheRequest.cs
- XAMLParseException.cs
- SimpleWorkerRequest.cs
- TimerElapsedEvenArgs.cs
- XmlSchemaExporter.cs
- BasicExpressionVisitor.cs
- StreamWithDictionary.cs
- FieldAccessException.cs
- TabPanel.cs
- DebugController.cs
- WindowsEditBox.cs
- _ConnectOverlappedAsyncResult.cs
- GlyphTypeface.cs
- UserControlParser.cs
- DecodeHelper.cs
- EventlogProvider.cs
- WinEventWrap.cs
- QualificationDataAttribute.cs
- XmlDataCollection.cs
- DebuggerAttributes.cs
- DataSourceCollectionBase.cs
- ExtensionElement.cs
- CodeTypeMember.cs
- AuthorizationRuleCollection.cs
- MouseCaptureWithinProperty.cs
- OpacityConverter.cs
- ByteStack.cs
- CheckBox.cs
- DataGridViewAdvancedBorderStyle.cs
- NeedSkipTokenVisitor.cs
- EdmItemCollection.cs
- Events.cs
- UshortList2.cs
- HtmlElementCollection.cs
- ContainerVisual.cs
- FilteredSchemaElementLookUpTable.cs
- XmlAutoDetectWriter.cs
- XmlSchemaInfo.cs
- StringWriter.cs
- LostFocusEventManager.cs
- FlowDecision.cs
- WmlPanelAdapter.cs
- RelationshipNavigation.cs
- MeasurementDCInfo.cs
- DiagnosticsConfigurationHandler.cs
- ValidatorCollection.cs
- RepeaterCommandEventArgs.cs
- TextEffectCollection.cs
- DefaultSettingsSection.cs
- SignedXmlDebugLog.cs