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 / 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
- RegexCompiler.cs
- CodeAttachEventStatement.cs
- MediaCommands.cs
- DataListItem.cs
- RegexMatchCollection.cs
- ElementUtil.cs
- WebPageTraceListener.cs
- XmlSerializer.cs
- ComponentResourceManager.cs
- QilDataSource.cs
- PageTheme.cs
- State.cs
- CodeDomConfigurationHandler.cs
- PartialCachingAttribute.cs
- ArraySegment.cs
- WindowInteropHelper.cs
- StorageRoot.cs
- DecoratedNameAttribute.cs
- TextTreeInsertElementUndoUnit.cs
- TextInfo.cs
- HyperLinkColumn.cs
- ManipulationDelta.cs
- ElementUtil.cs
- OperationResponse.cs
- VerticalAlignConverter.cs
- StatusBarItemAutomationPeer.cs
- ApplicationHost.cs
- FormsIdentity.cs
- DataObject.cs
- DataGridViewCellEventArgs.cs
- ApplicationServiceManager.cs
- WebColorConverter.cs
- TextPointer.cs
- PlanCompiler.cs
- _Rfc2616CacheValidators.cs
- StorageMappingItemCollection.cs
- TrackingParticipant.cs
- PreProcessor.cs
- Invariant.cs
- FieldTemplateFactory.cs
- AliasGenerator.cs
- DropShadowBitmapEffect.cs
- TemplateBindingExtension.cs
- _SslSessionsCache.cs
- LinkLabel.cs
- WebPartConnectionsCancelEventArgs.cs
- EditorPartDesigner.cs
- ObjectDataSourceMethodEventArgs.cs
- ScopelessEnumAttribute.cs
- XmlWellformedWriter.cs
- EntityKeyElement.cs
- XamlTypeMapper.cs
- SparseMemoryStream.cs
- FontWeight.cs
- UserControlParser.cs
- XmlNamespaceMapping.cs
- PathFigure.cs
- EntityConnectionStringBuilderItem.cs
- VerticalAlignConverter.cs
- TextSearch.cs
- CommandConverter.cs
- clipboard.cs
- propertyentry.cs
- UpdateTracker.cs
- DisplayInformation.cs
- ViewStateModeByIdAttribute.cs
- TagPrefixCollection.cs
- XmlReader.cs
- PagesSection.cs
- Message.cs
- LineServices.cs
- CancellationTokenRegistration.cs
- isolationinterop.cs
- DoubleLinkListEnumerator.cs
- PartialTrustVisibleAssembly.cs
- DynamicUpdateCommand.cs
- HtmlShim.cs
- RegistryKey.cs
- TextDecorationCollection.cs
- ExtendedProperty.cs
- SpeakInfo.cs
- Page.cs
- StructureChangedEventArgs.cs
- ManualResetEvent.cs
- FragmentQueryKB.cs
- AsyncPostBackErrorEventArgs.cs
- HttpCacheVary.cs
- ConsoleKeyInfo.cs
- PagePropertiesChangingEventArgs.cs
- WindowsAuthenticationModule.cs
- AccessText.cs
- AsyncPostBackErrorEventArgs.cs
- UniqueIdentifierService.cs
- ErasingStroke.cs
- SignedXml.cs
- TableCell.cs
- XmlSchemaSimpleTypeUnion.cs
- MetadataItem_Static.cs
- InkPresenterAutomationPeer.cs
- ProcessThreadCollection.cs