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
- DocumentViewerBaseAutomationPeer.cs
- X509Utils.cs
- ThemeInfoAttribute.cs
- DataGridViewRowConverter.cs
- MatrixTransform3D.cs
- MenuEventArgs.cs
- OdbcTransaction.cs
- BindingList.cs
- InputBindingCollection.cs
- Compilation.cs
- EventBuilder.cs
- IList.cs
- OracleString.cs
- Function.cs
- Converter.cs
- FileDialogCustomPlaces.cs
- wmiprovider.cs
- CodeParameterDeclarationExpression.cs
- path.cs
- SingleResultAttribute.cs
- TextControlDesigner.cs
- SwitchLevelAttribute.cs
- ZipIOExtraFieldZip64Element.cs
- XamlBuildTaskServices.cs
- CaseStatement.cs
- Int32RectConverter.cs
- EntityStoreSchemaGenerator.cs
- MultipleViewPattern.cs
- CodeTypeReference.cs
- Content.cs
- EditingMode.cs
- RegexStringValidatorAttribute.cs
- ToolBarButton.cs
- ItemContainerGenerator.cs
- Types.cs
- CacheHelper.cs
- JsonCollectionDataContract.cs
- _AutoWebProxyScriptEngine.cs
- ResourcePart.cs
- MetadataArtifactLoaderCompositeFile.cs
- SqlDependencyListener.cs
- PerspectiveCamera.cs
- CompModSwitches.cs
- ContentType.cs
- StyleXamlTreeBuilder.cs
- COM2ExtendedBrowsingHandler.cs
- SelectorItemAutomationPeer.cs
- PolicyStatement.cs
- FileStream.cs
- ProfileService.cs
- QueryReaderSettings.cs
- DbTransaction.cs
- WindowsAuthenticationModule.cs
- LogSwitch.cs
- UriExt.cs
- Task.cs
- FileVersionInfo.cs
- VirtualPath.cs
- RegexReplacement.cs
- RegisteredScript.cs
- LinearGradientBrush.cs
- UInt64Converter.cs
- SrgsSemanticInterpretationTag.cs
- CollectionType.cs
- Math.cs
- WindowsButton.cs
- EventRecordWrittenEventArgs.cs
- CardSpacePolicyElement.cs
- CompiledRegexRunnerFactory.cs
- StructuralCache.cs
- IfAction.cs
- MsmqIntegrationChannelListener.cs
- ThreadAbortException.cs
- HttpCookieCollection.cs
- PageParserFilter.cs
- ConnectionsZone.cs
- SqlBulkCopyColumnMappingCollection.cs
- LogManagementAsyncResult.cs
- SmtpReplyReader.cs
- DataBindingHandlerAttribute.cs
- InternalRelationshipCollection.cs
- EncoderFallback.cs
- HTTPNotFoundHandler.cs
- versioninfo.cs
- ScriptResourceHandler.cs
- PlatformCulture.cs
- ScriptingScriptResourceHandlerSection.cs
- CapabilitiesUse.cs
- DbConnectionStringCommon.cs
- NativeMethods.cs
- AssemblyHelper.cs
- StructuredTypeInfo.cs
- UTF8Encoding.cs
- WinInetCache.cs
- Exceptions.cs
- SafePointer.cs
- PropertyAccessVisitor.cs
- RotateTransform3D.cs
- TwoPhaseCommit.cs
- ObjRef.cs