Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Automation / Peers / HyperlinkAutomationPeer.cs / 1 / HyperlinkAutomationPeer.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: HyperlinkAutomationPeer.cs
//
// Description: Automation peer for hyperlink
//
//---------------------------------------------------------------------------
using System.Windows.Automation.Provider; // IRawElementProviderSimple
using System.Windows.Documents;
namespace System.Windows.Automation.Peers
{
///
public class HyperlinkAutomationPeer : TextElementAutomationPeer, IInvokeProvider
{
///
public HyperlinkAutomationPeer(Hyperlink owner)
: base(owner)
{ }
///
///
///
///
///
public override object GetPattern(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.Invoke)
{
return this;
}
return null;
}
//Default Automation properties
///
protected override AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Hyperlink;
}
///
///
///
protected override string GetNameCore()
{
string name = base.GetNameCore();
if (name == string.Empty)
{
Hyperlink owner = (Hyperlink)Owner;
name = owner.Text;
if (name == null)
name = string.Empty;
}
return name;
}
///
override protected string GetClassNameCore()
{
return "Hyperlink";
}
///
///
///
override protected bool IsControlElementCore()
{
return true;
}
//Invoke Pattern implementation
void IInvokeProvider.Invoke()
{
if (!IsEnabled())
throw new ElementNotEnabledException();
Hyperlink owner = (Hyperlink)Owner;
owner.DoClick();
}
}
}
// 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: HyperlinkAutomationPeer.cs
//
// Description: Automation peer for hyperlink
//
//---------------------------------------------------------------------------
using System.Windows.Automation.Provider; // IRawElementProviderSimple
using System.Windows.Documents;
namespace System.Windows.Automation.Peers
{
///
public class HyperlinkAutomationPeer : TextElementAutomationPeer, IInvokeProvider
{
///
public HyperlinkAutomationPeer(Hyperlink owner)
: base(owner)
{ }
///
///
///
///
///
public override object GetPattern(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.Invoke)
{
return this;
}
return null;
}
//Default Automation properties
///
protected override AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Hyperlink;
}
///
///
///
protected override string GetNameCore()
{
string name = base.GetNameCore();
if (name == string.Empty)
{
Hyperlink owner = (Hyperlink)Owner;
name = owner.Text;
if (name == null)
name = string.Empty;
}
return name;
}
///
override protected string GetClassNameCore()
{
return "Hyperlink";
}
///
///
///
override protected bool IsControlElementCore()
{
return true;
}
//Invoke Pattern implementation
void IInvokeProvider.Invoke()
{
if (!IsEnabled())
throw new ElementNotEnabledException();
Hyperlink owner = (Hyperlink)Owner;
owner.DoClick();
}
}
}
// 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
- InsufficientMemoryException.cs
- WindowsClaimSet.cs
- PersistenceParticipant.cs
- CqlWriter.cs
- TypeElementCollection.cs
- Token.cs
- ApplicationSecurityManager.cs
- StorageMappingItemLoader.cs
- StringSource.cs
- RegistryPermission.cs
- ScrollableControl.cs
- PersistenceException.cs
- FtpWebRequest.cs
- ResXResourceWriter.cs
- nulltextcontainer.cs
- NonNullItemCollection.cs
- InvalidPrinterException.cs
- CompiledQuery.cs
- TextServicesContext.cs
- CharStorage.cs
- Button.cs
- DescendentsWalker.cs
- StrongNameMembershipCondition.cs
- ActivityStatusChangeEventArgs.cs
- InternalResources.cs
- HandledMouseEvent.cs
- BasicCellRelation.cs
- DataServiceContext.cs
- ContextMenu.cs
- WebEvents.cs
- DrawingImage.cs
- GPPOINTF.cs
- PersonalizablePropertyEntry.cs
- DrawingContext.cs
- AlignmentXValidation.cs
- ScrollableControl.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- BypassElement.cs
- ScrollItemPattern.cs
- QueueException.cs
- TypefaceMap.cs
- UserMapPath.cs
- HighContrastHelper.cs
- BufferModeSettings.cs
- HTTPNotFoundHandler.cs
- RelationshipEndMember.cs
- HierarchicalDataBoundControlAdapter.cs
- AlphabeticalEnumConverter.cs
- GestureRecognitionResult.cs
- Line.cs
- RenderData.cs
- SqlProviderUtilities.cs
- LabelAutomationPeer.cs
- TailPinnedEventArgs.cs
- Serializer.cs
- SQLRoleProvider.cs
- WinCategoryAttribute.cs
- XmlReaderSettings.cs
- OpacityConverter.cs
- DoWhile.cs
- ScrollData.cs
- ComboBox.cs
- SelectQueryOperator.cs
- CommandEventArgs.cs
- SafeProcessHandle.cs
- BuildProvidersCompiler.cs
- IItemProperties.cs
- TableItemPattern.cs
- PackageRelationship.cs
- RefreshPropertiesAttribute.cs
- UnmanagedMarshal.cs
- XmlWrappingReader.cs
- XmlSchemaExternal.cs
- XamlFilter.cs
- TraceProvider.cs
- ModelItemDictionaryImpl.cs
- SQLDoubleStorage.cs
- CodeArgumentReferenceExpression.cs
- ScrollViewer.cs
- KeyedByTypeCollection.cs
- CuspData.cs
- Light.cs
- RawUIStateInputReport.cs
- SHA384.cs
- RoleGroup.cs
- ConfigurationProperty.cs
- odbcmetadatacollectionnames.cs
- QueueAccessMode.cs
- ViewStateException.cs
- PropertyConverter.cs
- PersonalizationStateQuery.cs
- PropertyToken.cs
- HtmlInputImage.cs
- PostBackOptions.cs
- FontInfo.cs
- dataobject.cs
- SocketStream.cs
- ProfileManager.cs
- ProcessInfo.cs
- CryptoHandle.cs