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
- SqlNotificationRequest.cs
- ConfigXmlCDataSection.cs
- SourceFilter.cs
- TextParentUndoUnit.cs
- RootBrowserWindowProxy.cs
- XmlSignatureManifest.cs
- SafeNativeMethodsMilCoreApi.cs
- WebBrowserPermission.cs
- AccessDataSource.cs
- StylusPointCollection.cs
- ResourceBinder.cs
- DispatcherExceptionEventArgs.cs
- WebBrowserHelper.cs
- followingquery.cs
- ParsedAttributeCollection.cs
- KeyInterop.cs
- WindowsScroll.cs
- ThicknessAnimation.cs
- TearOffProxy.cs
- TextBoxBase.cs
- DataColumnCollection.cs
- CodeFieldReferenceExpression.cs
- EditingScope.cs
- OleCmdHelper.cs
- BaseComponentEditor.cs
- StateMachine.cs
- RotateTransform3D.cs
- StringKeyFrameCollection.cs
- DigestComparer.cs
- RoleBoolean.cs
- StructuredTypeEmitter.cs
- WithParamAction.cs
- ColorKeyFrameCollection.cs
- IndexOutOfRangeException.cs
- XmlSubtreeReader.cs
- ArraySet.cs
- DesignBindingPropertyDescriptor.cs
- RSAOAEPKeyExchangeDeformatter.cs
- LogWriteRestartAreaState.cs
- DataRow.cs
- GridErrorDlg.cs
- Compiler.cs
- Brushes.cs
- InvokePattern.cs
- RegexMatchCollection.cs
- TemplatedAdorner.cs
- ServiceMemoryGates.cs
- coordinatorscratchpad.cs
- ListBase.cs
- SharedStream.cs
- activationcontext.cs
- ProtocolReflector.cs
- PolicyDesigner.cs
- ComboBoxAutomationPeer.cs
- DbReferenceCollection.cs
- ExpressionNormalizer.cs
- TabletCollection.cs
- EntityProxyFactory.cs
- TokenBasedSetEnumerator.cs
- COM2FontConverter.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- PrintingPermissionAttribute.cs
- ListItemsPage.cs
- webeventbuffer.cs
- CodeNamespaceImport.cs
- FontStretch.cs
- LayoutManager.cs
- SamlAction.cs
- Transform.cs
- LinqDataSource.cs
- GeometryDrawing.cs
- DummyDataSource.cs
- LicFileLicenseProvider.cs
- DCSafeHandle.cs
- FtpWebRequest.cs
- CompilationUnit.cs
- ListCollectionView.cs
- MultitargetUtil.cs
- CharUnicodeInfo.cs
- ColumnTypeConverter.cs
- PrintPreviewDialog.cs
- TextParagraphProperties.cs
- TextRange.cs
- GenerateTemporaryAssemblyTask.cs
- ToolboxComponentsCreatedEventArgs.cs
- InputLangChangeEvent.cs
- Exception.cs
- ToolStripSeparatorRenderEventArgs.cs
- CommandPlan.cs
- WizardStepBase.cs
- TemplateBindingExpression.cs
- ExtenderControl.cs
- Point3DCollection.cs
- DocumentPageView.cs
- DataTableExtensions.cs
- SourceItem.cs
- MSG.cs
- SqlCommandBuilder.cs
- KeyboardNavigation.cs
- OpenTypeCommon.cs