Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / HyperlinkAutomationPeer.cs / 1305600 / 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; } else { return base.GetPattern(patternInterface); } } //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; } else { return base.GetPattern(patternInterface); } } //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
- CollectionDataContractAttribute.cs
- DataService.cs
- ButtonFieldBase.cs
- Debugger.cs
- DrawingAttributesDefaultValueFactory.cs
- CssTextWriter.cs
- RuntimeCompatibilityAttribute.cs
- UIHelper.cs
- HtmlEmptyTagControlBuilder.cs
- XmlAnyElementAttribute.cs
- ActivityDesignerResources.cs
- WindowsGraphicsCacheManager.cs
- XmlMessageFormatter.cs
- NativeCppClassAttribute.cs
- SchemaTableOptionalColumn.cs
- EntityClientCacheKey.cs
- UIPermission.cs
- URIFormatException.cs
- TakeOrSkipWhileQueryOperator.cs
- ControlEvent.cs
- CodeCommentStatement.cs
- TypeDescriptionProviderAttribute.cs
- IpcClientManager.cs
- ListView.cs
- CounterCreationData.cs
- Baml6ConstructorInfo.cs
- GenericTypeParameterConverter.cs
- UpDownEvent.cs
- WebPartConnectionsDisconnectVerb.cs
- SQLInt16Storage.cs
- WebPartManager.cs
- MetadataCollection.cs
- TypeName.cs
- SocketAddress.cs
- DataGridViewCellConverter.cs
- StructuralComparisons.cs
- SettingsBase.cs
- TypeForwardedToAttribute.cs
- Rule.cs
- PartialCachingAttribute.cs
- WmlPageAdapter.cs
- BaseResourcesBuildProvider.cs
- EditCommandColumn.cs
- iisPickupDirectory.cs
- QueryOutputWriter.cs
- CharacterMetricsDictionary.cs
- RenderTargetBitmap.cs
- PolicyChain.cs
- CodeRegionDirective.cs
- XmlSchemaChoice.cs
- CompModSwitches.cs
- FrameworkReadOnlyPropertyMetadata.cs
- TcpAppDomainProtocolHandler.cs
- FormConverter.cs
- SingleStorage.cs
- Token.cs
- Pen.cs
- GeneralTransform3DGroup.cs
- ECDiffieHellman.cs
- XmlSchemaAttributeGroupRef.cs
- RowUpdatedEventArgs.cs
- ConfigurationSettings.cs
- DataGridViewComboBoxColumn.cs
- ToolboxBitmapAttribute.cs
- LogicalExpr.cs
- StrokeNode.cs
- SoundPlayer.cs
- WebPartActionVerb.cs
- PreviewControlDesigner.cs
- EventRoute.cs
- Point3DCollectionValueSerializer.cs
- SecurityKeyUsage.cs
- EntityConnectionStringBuilder.cs
- ValueExpressions.cs
- Header.cs
- TdsParserSessionPool.cs
- HtmlForm.cs
- ChangeProcessor.cs
- FullTextState.cs
- HandleExceptionArgs.cs
- PerfService.cs
- ActivationService.cs
- PointKeyFrameCollection.cs
- ToolStripManager.cs
- ByteKeyFrameCollection.cs
- MultilineStringConverter.cs
- EnumBuilder.cs
- UiaCoreProviderApi.cs
- MessageSecurityOverTcpElement.cs
- TextSegment.cs
- RootBrowserWindow.cs
- RegexGroup.cs
- EventLog.cs
- ChildTable.cs
- EntityDataSourceReferenceGroup.cs
- SessionPageStateSection.cs
- InternalResources.cs
- Point3DAnimationUsingKeyFrames.cs
- SessionPageStatePersister.cs
- AutomationPatternInfo.cs