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
- TypeReference.cs
- __ConsoleStream.cs
- SelectingProviderEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- RemoteWebConfigurationHost.cs
- SimpleWebHandlerParser.cs
- UIElementAutomationPeer.cs
- GetWinFXPath.cs
- MailMessageEventArgs.cs
- StorageSetMapping.cs
- Selector.cs
- TypeResolvingOptionsAttribute.cs
- TextStore.cs
- FileResponseElement.cs
- URLString.cs
- XamlFilter.cs
- ApplicationBuildProvider.cs
- SoapSchemaExporter.cs
- IdnMapping.cs
- ProcessHostConfigUtils.cs
- TransformPatternIdentifiers.cs
- TextEndOfSegment.cs
- WebServiceErrorEvent.cs
- OperationCanceledException.cs
- SocketElement.cs
- WebPartVerb.cs
- DesignRelation.cs
- WindowsEditBox.cs
- Parsers.cs
- WebConfigManager.cs
- RegistrationContext.cs
- StylusOverProperty.cs
- ColorConverter.cs
- EditorZone.cs
- RtfControls.cs
- SetStateEventArgs.cs
- DesignerHelpers.cs
- FindCriteria11.cs
- Bitmap.cs
- HWStack.cs
- DuplexChannelBinder.cs
- LinqDataSourceStatusEventArgs.cs
- DesignerFrame.cs
- EntitySqlQueryCacheKey.cs
- SqlTypeConverter.cs
- RuleSet.cs
- CreateSequence.cs
- CodeTypeDeclarationCollection.cs
- ContactManager.cs
- ApplicationBuildProvider.cs
- XmlAutoDetectWriter.cs
- ColumnWidthChangingEvent.cs
- X509CertificateCollection.cs
- HtmlElementCollection.cs
- Renderer.cs
- Triangle.cs
- SafeNativeMethods.cs
- Geometry3D.cs
- IssuanceLicense.cs
- FormDocumentDesigner.cs
- WorkflowServiceInstance.cs
- AdRotatorDesigner.cs
- GeometryCombineModeValidation.cs
- XmlAutoDetectWriter.cs
- _ProxyRegBlob.cs
- SignHashRequest.cs
- EntityUtil.cs
- SiteMapDataSourceView.cs
- UnsafeNativeMethods.cs
- LineServicesRun.cs
- XmlResolver.cs
- HttpCapabilitiesSectionHandler.cs
- ToolStripItem.cs
- SqlConnection.cs
- _Rfc2616CacheValidators.cs
- AppModelKnownContentFactory.cs
- SHA256.cs
- MsmqQueue.cs
- DefaultHttpHandler.cs
- ContentFilePart.cs
- HttpModulesSection.cs
- HtmlInputSubmit.cs
- WindowsListViewGroupSubsetLink.cs
- WorkflowServiceBehavior.cs
- SchemaNamespaceManager.cs
- SQLBoolean.cs
- DefaultEventAttribute.cs
- Utility.cs
- CreateParams.cs
- _SSPISessionCache.cs
- ManagedFilter.cs
- EntityDesignerUtils.cs
- DynamicFilter.cs
- TextTrailingWordEllipsis.cs
- GCHandleCookieTable.cs
- XXXOnTypeBuilderInstantiation.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- CriticalHandle.cs
- WorkflowInstanceProvider.cs
- OpCopier.cs